cat /etc/ansible/hosts
[vcentervms]
192.168.0.107
192.168.0.108
[root@localhost ~]# cat ansibleonvcentervms.yml
- hosts: vcentervms
user: root
become: yes
become_method: sudo
tasks:
- name: install ansible
yum: name=ansible state=installed
[root@localhost ~]#
[root@localhost ~]# ansible-playbook ansibleonvcentervms.yml
PLAY [vcentervms] **************************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.0.108]
ok: [192.168.0.107]
TASK [install ansible] *********************************************************
changed: [192.168.0.107]
changed: [192.168.0.108]
PLAY RECAP *********************************************************************
192.168.0.107 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
192.168.0.108 : ok=0 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[root@localhost ~]#
[vcentervms]
192.168.0.107
192.168.0.108
[root@localhost ~]# cat ansibleonvcentervms.yml
- hosts: vcentervms
user: root
become: yes
become_method: sudo
tasks:
- name: install ansible
yum: name=ansible state=installed
[root@localhost ~]#
[root@localhost ~]# ansible-playbook ansibleonvcentervms.yml
PLAY [vcentervms] **************************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.0.108]
ok: [192.168.0.107]
TASK [install ansible] *********************************************************
changed: [192.168.0.107]
changed: [192.168.0.108]
PLAY RECAP *********************************************************************
192.168.0.107 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
192.168.0.108 : ok=0 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[root@localhost ~]#
Comments
Post a Comment