diff --git a/05/chrony.conf b/05/chrony.conf new file mode 100644 index 0000000..e6a7abc --- /dev/null +++ b/05/chrony.conf @@ -0,0 +1,6 @@ +pool 0.de.pool.ntp.org iburst +pool 2.de.pool.ntp.org iburst + +makestep 1 3 +rtcsync + diff --git a/05/chrony_apt.yml b/05/chrony_apt.yml new file mode 100644 index 0000000..7cc054b --- /dev/null +++ b/05/chrony_apt.yml @@ -0,0 +1,17 @@ +--- +- hosts: apt + tasks: + + - name: Install Chrony + ansible.builtin.apt: name=chrony state=latest + + - name: Copy config file + ansible.builtin.copy: src=chrony.conf dest=/etc/chrony/chrony.conf mode=0644 owner=root group=root backup=yes + + - name: Restart Chrony with new config + ansible.builtin.service: name=chrony state=restarted + + - name: Start Chrony at boot + ansible.builtin.service: name=chrony enabled=yes + + diff --git a/05/chrony_yum.yml b/05/chrony_yum.yml new file mode 100644 index 0000000..49ba5c5 --- /dev/null +++ b/05/chrony_yum.yml @@ -0,0 +1,16 @@ +--- +- hosts: yum + tasks: + + - name: Install Chrony + ansible.builtin.yum: name=chrony state=latest + + - name: Copy config file + ansible.builtin.copy: src=chrony.conf dest=/etc/chrony.conf mode=0644 owner=root group=root backup=yes + + - name: Restart Chrony with new config + ansible.builtin.service: name=chronyd state=restarted + + - name: Start Chrony at boot + ansible.builtin.service: name=chronyd enabled=yes + diff --git a/05/chrony_zypper_mit_python-xml_fuer_Py2.yml b/05/chrony_zypper_mit_python-xml_fuer_Py2.yml new file mode 100644 index 0000000..93a6458 --- /dev/null +++ b/05/chrony_zypper_mit_python-xml_fuer_Py2.yml @@ -0,0 +1,22 @@ +--- +- hosts: zypper + tasks: + + - name: "zypper module dependency (Py2 only)" + ansible.builtin.command: zypper -n install python-xml + args: + creates: /usr/lib*/python2.*/xml/dom/minidom.py + when: ansible_python.version.major|default(2) == 2 + + - name: Install Chrony + community.general.zypper: name=chrony state=latest + + - name: Copy config file + ansible.builtin.copy: src=chrony.conf dest=/etc/chrony.conf mode=0644 owner=root group=root backup=yes + + - name: Restart Chrony with new config + ansible.builtin.service: name=chronyd state=restarted + + - name: Start Chrony at boot + ansible.builtin.service: name=chronyd enabled=yes + diff --git a/05/old.ntp/ntp.conf b/05/old.ntp/ntp.conf new file mode 100644 index 0000000..6a183f3 --- /dev/null +++ b/05/old.ntp/ntp.conf @@ -0,0 +1,22 @@ +driftfile /var/lib/ntp/ntp.drift + +leapfile /usr/share/zoneinfo/leap-seconds.list + +statistics loopstats peerstats clockstats +filegen loopstats file loopstats type day enable +filegen peerstats file peerstats type day enable +filegen clockstats file clockstats type day enable + +pool 0.debian.pool.ntp.org iburst +pool 1.debian.pool.ntp.org iburst +pool 2.debian.pool.ntp.org iburst +pool 3.debian.pool.ntp.org iburst + +restrict -4 default kod notrap nomodify nopeer noquery limited +restrict -6 default kod notrap nomodify nopeer noquery limited + +restrict 127.0.0.1 +restrict ::1 + +restrict source notrap nomodify noquery + diff --git a/05/old.ntp/ntp_apt.yml b/05/old.ntp/ntp_apt.yml new file mode 100644 index 0000000..a766135 --- /dev/null +++ b/05/old.ntp/ntp_apt.yml @@ -0,0 +1,17 @@ +--- +- hosts: apt + + tasks: + + - name: Install NTP + apt: name=ntp state=latest + + - name: Copy ntp.conf + copy: src=ntp.conf dest=/etc/ntp.conf backup=yes + + - name: Restart NTP + service: name=ntp state=restarted + + - name: Enable NTP + service: name=ntp enabled=yes state=started + diff --git a/05/old.ntp/ntp_yum.yml b/05/old.ntp/ntp_yum.yml new file mode 100644 index 0000000..0483df5 --- /dev/null +++ b/05/old.ntp/ntp_yum.yml @@ -0,0 +1,17 @@ +--- +- hosts: yum + + tasks: + + - name: Install NTP + yum: name=ntp state=latest + + - name: Copy ntp.conf + copy: src=ntp.conf dest=/etc/ntp.conf backup=yes + + - name: Restart NTP + service: name=ntpd state=restarted + + - name: Enable NTP + service: name=ntpd enabled=yes state=started + diff --git a/05/old.ntp/ntp_zypper.yml b/05/old.ntp/ntp_zypper.yml new file mode 100644 index 0000000..f647ad0 --- /dev/null +++ b/05/old.ntp/ntp_zypper.yml @@ -0,0 +1,23 @@ +--- +- hosts: zypper + + tasks: + + - name: "Python2: Zypper module dependency" + command: zypper -n install python-xml + args: + creates: /usr/lib*/python2.*/xml/dom/minidom.py + when: ansible_python.version.major == "2" + + - name: Install NTP + zypper: name=ntp state=latest + + - name: Copy ntp.conf + copy: src=ntp.conf dest=/etc/ntp.conf backup=yes + + - name: Restart NTP + service: name=ntpd state=restarted + + - name: Enable NTP + service: name=ntpd enabled=yes state=started +