feat: use ansible block
This commit is contained in:
parent
7d762d095d
commit
b5c819fb27
12 changed files with 399 additions and 424 deletions
|
|
@ -1,23 +1,25 @@
|
|||
---
|
||||
|
||||
# install chrony
|
||||
- name: "ntp - install - chrony debian"
|
||||
ansible.builtin.apt:
|
||||
name: "chrony"
|
||||
state: "present"
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
tags:
|
||||
- "ntp"
|
||||
- name: "manage ntp"
|
||||
block:
|
||||
|
||||
# install chrony
|
||||
- name: "ntp - install - chrony debian"
|
||||
ansible.builtin.apt:
|
||||
name: "chrony"
|
||||
state: "present"
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
|
||||
# configure chrony
|
||||
- name: "ntp - config - configure chrony"
|
||||
ansible.builtin.template:
|
||||
src: "templates/chrony/chrony.conf.j2"
|
||||
dest: "/etc/chrony/chrony.conf"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
notify: "restart chrony"
|
||||
|
||||
# configure chrony
|
||||
- name: "ntp - config - configure chrony"
|
||||
ansible.builtin.template:
|
||||
src: "templates/chrony/chrony.conf.j2"
|
||||
dest: "/etc/chrony/chrony.conf"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
notify: "restart chrony"
|
||||
tags:
|
||||
- "ntp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue