miquelMariano.ESXi_ntp_config
Role Name
ESXi_ntp_config configures NTP servers on our ESXi servers.
Requirements
No specific requirements.
Role Variables
You need to define the variables ntp1 and ntp2 in your inventory file.
Example:
[all]
servers_group1
servers_group2
[servers_group1]
server1
server2
server3
[servers_group2]
server11
server12
server13
[all:vars]
ntp1='0.pool.ntp.org'
ntp2='1.pool.ntp.org'
Dependencies
No dependencies.
Example Playbook
This playbook runs when the variable update_mode
is set to "true" and makes sure the role is up to date. By default, update_mode
is "false".
The directory miquelMariano.ESXi_{{ role }}
must exist. If it doesn’t, the playbook will not find the role and will fail. You should create the directory manually using mkdir /etc/ansible/my_role
.
###
###ESXi_config.yml
###
- hosts: ansible
user: root
tasks:
- name: Ensure that the role is up to date
command: ansible-galaxy install --force {{ item }}
with_items:
- miquelMariano.ESXi_{{ role }}
when:
- update_mode | default(False)
tags: update
ignore_errors: yes
- hosts: "{{ servers }}:!localhost"
user: root
serial: 1
roles:
- role: miquelMariano.ESXi_{{ role }}
~
~
~
Usage
Run the following command to execute the playbook:
ansible-playbook playbooks/ESXi_config.yml -i inventory/ESXi --extra-vars "servers=servers_group1 role=ntp_config update_mode=true" --tags "update|set|get"
License
BSD
Author Information
Installa
ansible-galaxy install miquelMariano.ESXi_ntp_config
Licenza
Unknown
Download
69
Proprietario