Compare commits
10 Commits
ea2a253234
...
13bc52079c
Author | SHA1 | Date | |
---|---|---|---|
13bc52079c | |||
8a32e185f3 | |||
335b9d6c94 | |||
92c708e486 | |||
c80a55fe7d | |||
735fb9eb92 | |||
4b842d6fce | |||
ca675d8829 | |||
ce618f3b68 | |||
ef5e9b6c23 |
@ -5,5 +5,7 @@ skip_list:
|
|||||||
- '201'
|
- '201'
|
||||||
- '305'
|
- '305'
|
||||||
- '403'
|
- '403'
|
||||||
|
- '701'
|
||||||
|
- '703'
|
||||||
use_default_rules: true
|
use_default_rules: true
|
||||||
verbosity: 1
|
verbosity: 1
|
||||||
|
@ -64,6 +64,9 @@ stages:
|
|||||||
script:
|
script:
|
||||||
- cp -av ${ANSIBLE_ROLE_PATH} /etc/ansible/roles/${ANSIBLE_ROLE}
|
- cp -av ${ANSIBLE_ROLE_PATH} /etc/ansible/roles/${ANSIBLE_ROLE}
|
||||||
- ansible-playbook -v --connection=local ${ANSIBLE_EXTRA_VARS} tests/test.yml
|
- ansible-playbook -v --connection=local ${ANSIBLE_EXTRA_VARS} tests/test.yml
|
||||||
|
- cat /etc/ntp.conf
|
||||||
|
- ansible-playbook -v --connection=local ${ANSIBLE_EXTRA_VARS} tests/test.yml -e ntp_node_type=client
|
||||||
|
- cat /etc/ntp.conf
|
||||||
### END TEMPLATES ###
|
### END TEMPLATES ###
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
---
|
---
|
||||||
# defaults file for zen_ntp
|
# defaults file for zen_ntp
|
||||||
|
|
||||||
|
|
||||||
ntp_conf_file : "/etc/ntp.conf"
|
ntp_conf_file : "/etc/ntp.conf"
|
||||||
ntp_conf_version : "1.0"
|
ntp_conf_version : "1.0"
|
||||||
ntp_conf_revision : "20200429-232122"
|
ntp_conf_revision : "20201009-043644"
|
||||||
|
|
||||||
|
|
||||||
|
ntp_service: ntpd
|
||||||
|
|
||||||
|
|
||||||
ntp_node_type : server
|
ntp_node_type : server
|
||||||
@ -13,6 +14,7 @@
|
|||||||
ntp_network : 10.0.0.0
|
ntp_network : 10.0.0.0
|
||||||
ntp_netmask : 255.0.0.0
|
ntp_netmask : 255.0.0.0
|
||||||
|
|
||||||
|
|
||||||
ntp_lan_server : 10.10.10.55
|
ntp_lan_server : 10.10.10.55
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# handlers file for zen_ntp
|
# handlers file for zen_ntp
|
||||||
- name: restart ntpd
|
- name: restart ntpd
|
||||||
service:
|
service:
|
||||||
name : ntpd
|
name : "{{ ntp_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
when: ansible_virtualization_type != "docker"
|
when: ansible_virtualization_type != "docker"
|
||||||
|
@ -1,9 +1,23 @@
|
|||||||
---
|
---
|
||||||
# tasks file for zen_ntp
|
# tasks file for zen_ntp
|
||||||
|
- name: set service name for debian if required
|
||||||
|
set_fact:
|
||||||
|
ntp_service: ntp
|
||||||
|
when: ansible_distribution == "Debian"
|
||||||
|
|
||||||
|
|
||||||
|
- name: set package and service for centos 8/9
|
||||||
|
set_fact:
|
||||||
|
ntp_pkg : chrony
|
||||||
|
ntp_service : chronyd
|
||||||
|
when:
|
||||||
|
- (ansible_distribution_major_version == "8" or
|
||||||
|
ansible_distribution_major_version == "9")
|
||||||
|
|
||||||
|
|
||||||
- name: install ntp if not present
|
- name: install ntp if not present
|
||||||
package:
|
package:
|
||||||
name : ntp
|
name : "{{ ntp_pkg | default('ntp') }}"
|
||||||
state : present
|
state : present
|
||||||
|
|
||||||
|
|
||||||
@ -17,9 +31,9 @@
|
|||||||
notify: restart ntpd
|
notify: restart ntpd
|
||||||
|
|
||||||
|
|
||||||
- name: enable/start ntpd
|
- name: enable/start ntpd or chrony
|
||||||
service:
|
service:
|
||||||
name: ntpd
|
name: "{{ ntp_service }}"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: started
|
state: started
|
||||||
when: ansible_distribution_major_version == "7" and ansible_virtualization_type != "docker"
|
when: ansible_virtualization_type != "docker"
|
||||||
|
@ -19,7 +19,7 @@ restrict {{ ntp_network }} mask {{ ntp_netmask }} nomodify notrap
|
|||||||
server {{ server }}
|
server {{ server }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
server {{ ntp_lan_server }}
|
server {{ ntp_lan_server }} iburst
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
includefile /etc/ntp/crypto/pw
|
includefile /etc/ntp/crypto/pw
|
||||||
|
Loading…
x
Reference in New Issue
Block a user