[root@abc-60 ~]# cat test.yml
---
- hosts: te
tasks:
- name: "copy"
copy:
src: /tmp/censor-srv.txt
dest: /tmp/censor-srv.txt
- name: unarchive tar.gz
unarchive: src=./redis-6.0.5.tar.gz dest=/tmp/
- name: yum packages
yum: name={{ item }}
with_items:
- httpd
- gcc-c++
- gcc
- tcl-devel
- openssl-devel
- name: sync
synchronize: src=/usr/local/blackbox_exporter-0.16.0.linux-amd64 dest=/tmp/blackbox_exporter archive=no recursive=yes
- name: install shell
shell: cd /tmp/redis-6.0.5 && make PREFIX=/usr/local/redis install
[root@abc-60 ~]# cat /etc/ansible/hosts
[te]
192.98.2.194 ansible_ssh_user=root ansible_ssh_pass='1223'
192.98.2.200 ansible_ssh_user=root ansible_ssh_pass='123q'