ansible playbook

ansible playbook 详解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
source /home/conda/bin/activate ansible                      # 首选执行 conda 激活这个ansible环境
export TOOLS_ROOT=/work/jenkins/workspace/aais-sh/tools
export TOOLS_ANSIBLE=${TOOLS_ROOT}/ansible
export ANSIBLE_CONFIG=${TOOLS_ANSIBLE}/ansible.cfg

ansible --version
ansible-playbook --version

ansible-playbook -i ${TOOLS_ANSIBLE}/inventory.conf ${TOOLS_ANSIBLE}/telegraf.yaml --list-tasks

playbook: /work/jenkins/workspace/aais-sh/tools/ansible/telegraf.yaml

play #1 (core): core TAGS: []
tasks:
create telegraf path TAGS: []
copy telegraf file TAGS: []
copy telegraf.sh file TAGS: []
copy telegraf.conf file TAGS: []
start telegraf agent TAGS: []


ansible-playbook -i ${TOOLS_ANSIBLE}/inventory.conf ${TOOLS_ANSIBLE}/telegraf.yaml --list-hosts

playbook: /work/jenkins/workspace/aais-sh/tools/ansible/telegraf.yaml

play #1 (core): core TAGS: []
pattern: ['core']
hosts (3):
192.168.12.19
192.168.12.20
192.168.12.91