Debian Codegraph @

ansible_collections/cisco/ucs/playbooks/ucs_ntp_server.yml

raw symbols SCIP
1 ---
2 # Example Playbook: cisco.ucs.ucs_dns_server
3 - hosts: ucs
4 connection: local
5 gather_facts: false
6
7 tasks:
8 - name: Test that we have a UCS hostname, UCS username, and UCS password
9 fail:
10 msg: 'Please define the following variables: ucs_hostname, ucs_username and ucs_password.'
11 when: ucs_hostname is not defined or ucs_username is not defined or ucs_password is not defined
12 vars:
13 # use "<<: *login_info" to substite the information below in each task
14 # this is not required, however it makes the playbook shorter.
15 login_info: &login_info
16 hostname: "{{ ucs_hostname }}"
17 username: "{{ ucs_username }}"
18 password: "{{ ucs_password }}"
19
20 - name: Configure NTP server
21 cisco.ucs.ucs_ntp_server:
22 <<: *login_info
23 ntp_server: 10.10.10.10
24 description: Internal NTP Server by IP address
25 state: present
26 delegate_to: localhost
27
28 - name: Configure NTP server
29 cisco.ucs.ucs_ntp_server:
30 <<: *login_info
31 ntp_server: pool.ntp.org
32 description: External NTP Server by hostname
33 state: present
34 delegate_to: localhost
35
36 - name: Remove NTP server
37 cisco.ucs.ucs_ntp_server:
38 <<: *login_info
39 ntp_server: 10.10.10.10
40 state: absent
41 delegate_to: localhost
42
43 - name: Remove NTP server
44 cisco.ucs.ucs_ntp_server:
45 <<: *login_info
46 ntp_server: pool.ntp.org
47 state: absent
48 delegate_to: localhost