[root@host1 ~]# ansible-playbook docker.yml
PLAY [test] ********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.1.20]
ok: [192.168.1.10]
TASK [安装yum-utils工具] ***********************************************************
[WARNING]: Consider using the yum module rather than running 'yum'. If you
need to use command because yum is insufficient you can add 'warn: false' to
this command task or set 'command_warnings=False' in ansible.cfg to get rid of
this message.
changed: [192.168.1.20]
changed: [192.168.1.10]
TASK [安装docker的repo源] **********************************************************
changed: [192.168.1.20]
changed: [192.168.1.10]
TASK [安装docker] ****************************************************************
changed: [192.168.1.20]
changed: [192.168.1.10]
PLAY RECAP *********************************************************************
192.168.1.10 : ok=4 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
192.168.1.20 : ok=4 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[root@host1 ~]# systemctl start docker
[root@host1 ~]# docker --version
Docker version 20.10.2, build 2291f61