我只想为特定的 ansible 任务(如get_url模块)设置一个环境代理,以便从 Internet 下载一些应用程序。其他所有任务都应该在没有任何代理的情况下运行。我如何完成这项任务。
我已经为使用Filebeat的集中式日志记录系统配置了ELK-stack(Elasticsearch,Logstash和Kibana)集群。现在,我被要求使用Filebeat重新配置为EFK(Elasticsearch,FluentD和Kibana)。我已禁用Logstash并安装了FluentD,但无法使用Filebeat配置FluentD。我已经为Filebeat 安装了FluentD插件并进行了修改/etc/td-agent/td-agent.conf,但似乎无法正常工作。
td-agent.conf
<source>
@type beats
tag record['@metadata']['beat']
port 5044
bind 0.0.0.0
</source>
<match *.**>
@type copy
<store>
#@type file
@type elasticsearch_dynamic
logstash_format true
logstash_prefix ${tag_parts[0]}
type_name ${record['type']}
</store>
<store>
@type file
logstash_format true
logstash_prefix ${tag_parts[0]}
type_name ${record['type']}
path /var/log/td-agent/data_logs.*.log
</store>
</match>
Run Code Online (Sandbox Code Playgroud) 我写了一个ansible任务来创建ec2实例并将主机添加为动态主机.该任务完美地工作并创建了实例,但我无法检索实例信息.
My Ansible版本:2.2.0.0/Ubuntu 14.04
这是我的代码
- name: launch ec2 instance for QA
local_action:
module: ec2
key_name: "{{ ec2_keypair }}"
group: "{{ ec2_security_group }}"
instance_type: "{{ ec2_instance_type }}"
image: "{{ ec2_image }}"
vpc_subnet_id: "{{ ec2_subnet_ids }}"
region: "{{ ec2_region }}"
instance_tags: '{"Name":"{{ec2_tag_Name}}","Type":"{{ec2_tag_Type}}","Environment":"{{ec2_tag_Environment}}"}'
assign_public_ip: yes
wait: true
count: 1
register: ec2
- debug: var=item
with_items: ec2.instances
- add_host: name={{ item.public_ip }} >
groups=dynamically_created_hosts
with_items: ec2.instances
- name: Wait for the instances to boot by checking the ssh port
wait_for: host={{item.public_ip}} port=22 delay=60 …Run Code Online (Sandbox Code Playgroud)