VMware: Improve vmware_host_ntp module (#47273)

This commit is contained in:
Christian Kotte
2018-12-20 12:07:23 +07:00
committed by Abhijeet Kasurde
parent bdcf310e5d
commit 3f8d541326
2 changed files with 308 additions and 147 deletions

View File

@@ -55,7 +55,7 @@
- debug: var=ccr1
- debug: var=host1
- name: Change facts about all hosts in given cluster
- name: Add NTP server to a host
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
@@ -69,7 +69,7 @@
- debug: var=present
- name: Change facts about all hosts in given cluster
- name: Add another NTP server to a host
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
@@ -83,7 +83,7 @@
- debug: var=present
- name: Change facts about all hosts in given cluster
- name: Remove NTP server from a host
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
@@ -93,11 +93,11 @@
ntp_server:
- 1.pool.ntp.org
validate_certs: no
register: present
register: absent_one
- debug: var=present
- debug: var=absent_one
- name: Change facts about all hosts in given cluster
- name: Remove NTP server from a host
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
@@ -111,7 +111,7 @@
- debug: var=present
- name: Change facts about all hosts in given cluster
- name: Add more NTP servers to a host
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
@@ -127,7 +127,7 @@
- debug: var=present
- name: Change facts about all hosts in given cluster
- name: Remove all NTP servers from a host
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
@@ -142,11 +142,42 @@
- 4.pool.ntp.org
- 6.pool.ntp.org
validate_certs: no
register: present
register: absent_all
- debug: var=present
- debug: var=absent_all
- name: Change facts about all hosts in given cluster in check mode
- name: Configure NTP servers for a host
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
ntp_server:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
validate_certs: no
register: ntp_servers
- debug: var=ntp_servers
- name: Configure NTP servers for a host
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
ntp_server:
- 3.pool.ntp.org
- 4.pool.ntp.org
- 5.pool.ntp.org
verbose: true
validate_certs: no
register: ntp_servers
- debug: var=ntp_servers
- name: Add NTP server to a host in check mode
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
@@ -161,69 +192,7 @@
- debug: var=present
- name: Change facts about all hosts in given cluster in check mode
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: present
ntp_server:
- 1.pool.ntp.org
validate_certs: no
register: present
check_mode: yes
- debug: var=present
- name: Change facts about all hosts in given cluster in check mode
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: absent
ntp_server:
- 1.pool.ntp.org
validate_certs: no
register: present
check_mode: yes
- debug: var=present
- name: Change facts about all hosts in given cluster in check mode
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: present
ntp_server:
- 1.pool.ntp.org
validate_certs: no
register: present
check_mode: yes
- debug: var=present
- name: Change facts about all hosts in given cluster in check mode
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: present
ntp_server:
- 2.pool.ntp.org
- 3.pool.ntp.org
- 4.pool.ntp.org
validate_certs: no
register: present
check_mode: yes
- debug: var=present
- name: Change facts about all hosts in given cluster in check mode
- name: Remove NTP server to a host in check mode
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
@@ -232,13 +201,24 @@
state: absent
ntp_server:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
- 3.pool.ntp.org
- 4.pool.ntp.org
- 6.pool.ntp.org
validate_certs: no
register: present
check_mode: yes
- debug: var=present
- name: Configure NTP servers for a host in check mode
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
ntp_server:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
validate_certs: no
register: ntp_servers
check_mode: yes
- debug: var=ntp_servers