Print the value of ntp_service_install.
This commit is contained in:
parent
7640d6379e
commit
a9ec075ebc
|
@ -1,25 +1,32 @@
|
|||
---
|
||||
- name: Display the value of ntp_service_install
|
||||
ansible.builtin.debug:
|
||||
msg: "ntp_service_install: {{ ntp_service_install }}"
|
||||
|
||||
- block:
|
||||
- name: Install the ntp server
|
||||
apt: pkg=ntp state=present cache_valid_time=3600
|
||||
when: ntp_service_install
|
||||
|
||||
- name: Install the ntp configuration.
|
||||
template: src=ntp.conf.j2 dest=/etc/ntp.conf owner=root group=root mode=0644
|
||||
when: ntp_service_install
|
||||
notify: Restart the ntp server
|
||||
|
||||
- name: Ensure that the ntp server is running
|
||||
service: name=ntp state=started enabled=yes
|
||||
when: ntp_service_enabled
|
||||
when:
|
||||
- ntp_service_install
|
||||
- ntp_service_enabled
|
||||
|
||||
- name: Ensure that the ntp package is not installed
|
||||
ansible.builtin.apt:
|
||||
pkg: ntp
|
||||
state: absent
|
||||
when: not ntp_service_enabled
|
||||
when: not ntp_service_install
|
||||
|
||||
when:
|
||||
- ansible_distribution_file_variety == "Debian"
|
||||
- ntp_service_install
|
||||
tags: [ 'packages', 'ntp' ]
|
||||
|
||||
- block:
|
||||
|
|
Loading…
Reference in New Issue