adding cluster to vcenter

[root@localhost ~]# cat addcluster.yml
---
- hosts: localhost
  gather_facts: false
  connection: local
  tasks:
   - name: Create Cluster
     vmware_cluster:
       hostname: 192.168.0.103
       username: root
       password: vmware
       validate_certs: no
       datacenter_name: dc
       cluster_name: cluster1
       enable_ha: yes
       enable_drs: yes
     delegate_to: localhost

[root@localhost ~]#


[root@localhost ~]# vi addcluster.yml
[root@localhost ~]# ansible-playbook addcluster.yml

PLAY [localhost] *************************************************************************************************************************************

TASK [Create Cluster] ********************************************************************************************************************************
changed: [localhost -> localhost]

PLAY RECAP *******************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0 

[root@localhost ~]# vi addcluster.yml
[root@localhost ~]# ansible-playbook addcluster.yml

PLAY [localhost] *************************************************************************************************************************************

TASK [Create Cluster] ********************************************************************************************************************************
changed: [localhost -> localhost]

PLAY RECAP *******************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0 

[root@localhost ~]#

delete cluster


---
- hosts: localhost
  gather_facts: false
  connection: local
  tasks:
   - name: delete Cluster
     vmware_cluster:
       hostname: 192.168.0.103
       username: root
       password: vmware
       validate_certs: no
       datacenter_name: dc
       cluster_name: cluster1
       enable_ha: yes
       enable_drs: yes
       state: absent

[root@localhost ~]# ansible-playbook deletecluster.yml

PLAY [localhost] *************************************************************************************************************************************

TASK [delete Cluster] ********************************************************************************************************************************
changed: [localhost]

PLAY RECAP *******************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0 



https://docs.google.com/document/d/e/2PACX-1vT0Hx70EbNIZ4h7aJTPQ9-sx5c4v0polB7Yix-P7b1i0Uz5cDx75zVHssFUtBgrudDR3EijmdNodEfz/pub

Comments

Popular posts from this blog

ansible redhat cluster qorum qdevice

PE 3.9.0 on centos 6

gfs2 cluster