1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_ntp.git synced 2024-08-16 12:59:49 +02:00

Compare commits

...

13 commits
v1.2.5 ... main

Author SHA1 Message Date
L3D
c3fabc5fc6
Merge pull request #20 from roles-ansible/dependabot/github_actions/ansible-actions/yamllint-action-0.0.2
Bump ansible-actions/yamllint-action from 0.0.1 to 0.0.2
2024-03-22 11:23:46 +01:00
L3D
1dc572a323
Merge pull request #21 from roles-ansible/dependabot/github_actions/ansible-actions/ansible-lint-action-1.0.3
Bump ansible-actions/ansible-lint-action from 1.0.2 to 1.0.3
2024-03-22 11:23:37 +01:00
dependabot[bot]
59d5fa615a
Bump ansible-actions/ansible-lint-action from 1.0.2 to 1.0.3
Bumps [ansible-actions/ansible-lint-action](https://github.com/ansible-actions/ansible-lint-action) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/ansible-actions/ansible-lint-action/releases)
- [Commits](https://github.com/ansible-actions/ansible-lint-action/compare/v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: ansible-actions/ansible-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 07:54:20 +00:00
dependabot[bot]
1191c064fc
Bump ansible-actions/yamllint-action from 0.0.1 to 0.0.2
Bumps [ansible-actions/yamllint-action](https://github.com/ansible-actions/yamllint-action) from 0.0.1 to 0.0.2.
- [Release notes](https://github.com/ansible-actions/yamllint-action/releases)
- [Commits](https://github.com/ansible-actions/yamllint-action/compare/v0.0.1...v0.0.2)

---
updated-dependencies:
- dependency-name: ansible-actions/yamllint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 07:54:16 +00:00
L3D
262d12ab23
Merge pull request #19 from roles-ansible/dependabot/github_actions/ansible-actions/ansible-galaxy-action-1.2.0
Bump ansible-actions/ansible-galaxy-action from 1.1.1 to 1.2.0
2024-01-25 00:26:29 +01:00
dependabot[bot]
0dabbd7c42
Bump ansible-actions/ansible-galaxy-action from 1.1.1 to 1.2.0
Bumps [ansible-actions/ansible-galaxy-action](https://github.com/ansible-actions/ansible-galaxy-action) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/ansible-actions/ansible-galaxy-action/releases)
- [Commits](https://github.com/ansible-actions/ansible-galaxy-action/compare/v1.1.1...v1.2.0)

---
updated-dependencies:
- dependency-name: ansible-actions/ansible-galaxy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 08:06:15 +00:00
L3D
09864d03a2
Merge pull request #18 from roles-ansible/ntf
notify systemd on directory update
2023-11-28 03:50:39 +01:00
L3D
b65dfe4504
notify systemd on directory update 2023-11-28 03:49:51 +01:00
L3D
cac94e5c60
Merge pull request #17 from roles-ansible/file
change file premissions recursivly
2023-11-28 03:41:05 +01:00
L3D
ca0c9f60b5
change file premissions recursivly 2023-11-28 03:40:01 +01:00
L3D
5adecb3a0e
Merge pull request #16 from roles-ansible/ntp
consider using ntpsec
2023-11-28 03:20:00 +01:00
L3D
48fcac7e4c
fix logfile permissions 2023-11-28 03:18:03 +01:00
L3D
bc84cec5fb
consider using ntpsec for Debian instead of ntp 2023-11-28 03:05:59 +01:00
19 changed files with 85 additions and 22 deletions

View file

@ -17,7 +17,7 @@ jobs:
fetch-depth: 0
- name: Run ansible-lint
uses: ansible-actions/ansible-lint-action@v1.0.2
uses: ansible-actions/ansible-lint-action@v1.0.3
with:
target: "./"
collections_yml: "requirements.yml"

View file

@ -19,6 +19,6 @@ jobs:
fetch-depth: 0
- name: 'Release on galaxy'
uses: ansible-actions/ansible-galaxy-action@v1.1.1
uses: ansible-actions/ansible-galaxy-action@v1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}

View file

@ -17,6 +17,6 @@ jobs:
fetch-depth: 0
- name: Run yamllint
uses: ansible-actions/yamllint-action@v0.0.1
uses: ansible-actions/yamllint-action@v0.0.2
with:
target: "./"

View file

@ -38,6 +38,10 @@ ntp_servers:
ntp_set_time_zone: false
ntp_timezone: 'Europe/Berlin'
# Leap seconds definition provided by tzdata
ntp_leap: true
ntp_leapfile: '/usr/share/zoneinfo/leap-seconds.list'
# Enable or disable ntp statistics
ntp_statistics: false
@ -83,6 +87,9 @@ You can install it with this command:
ansible-galaxy collection install -r requirements.yml --upgrade
```
## Testing
This role is tested on debian stable. It should work on other operating systems. Please Report issues if it does not work.
## Author Information
+ This role was created in 2018 by diodonfrost.

View file

@ -20,10 +20,19 @@ ntp_servers:
# Enable or disable ntp statistics
ntp_statistics: false
ntp_ntpstats_dir: '/var/log/ntpstats/'
ntp_statistics_overview:
- 'clockstats'
- 'peerstats'
- 'loopstats'
# optionally set timezone
ntp_set_time_zone: false
ntp_timezone: 'Europe/Berlin'
# Leap seconds definition provided by tzdata
ntp_leap: true
ntp_leapfile: '/usr/share/zoneinfo/leap-seconds.list'
# version check for this playbook (true is recomended)
submodules_versioncheck: false

View file

@ -1,7 +1,7 @@
---
- name: Restart ntp daemons on Linux
become: true
ansible.builtin.service:
ansible.builtin.systemd:
name: "{{ ntp_service }}"
state: restarted

View file

@ -8,3 +8,13 @@
group: "{{ ntp_configfile_group }}"
mode: 0644
notify: "Restart ntp daemons on {{ ansible_system }}"
- name: Create logging folder
become: true
ansible.builtin.file:
path: "{{ ntp_ntpstats_dir }}"
state: directory
recurse: true
mode: 'u=rwX,g=rX,o=rX'
owner: "{{ ntp_user }}"
notify: "Restart ntp daemons on {{ ansible_system }}"

View file

@ -16,7 +16,13 @@
when: ansible_os_family == "Gentoo"
tags: 'skip_ansible_lint'
- name: Install ntp daemon on Linux
- name: Remove ntp legacy daemon on Linux
become: true
ansible.builtin.package:
name: "{{ ntp_package_absent }}"
state: absent
- name: Install ntpsec daemon on Linux
become: true
ansible.builtin.package:
name: "{{ ntp_package }}"
@ -24,7 +30,7 @@
- name: Service ntp on Linux
become: true
ansible.builtin.service:
ansible.builtin.systemd:
name: "{{ ntp_service }}"
enabled: true
state: started

View file

@ -1,13 +1,18 @@
#####################################
## ##
## THIS FILE IS MANAGED BY ANSIBLE ##
## ##
## It is about time ##
## ##
#####################################
# > galaxy.ansible.com/do1jlr/ntp < #
######################################################
## ##
## THIS FILE IS MANAGED BY ANSIBLE ##
## ##
## It is about time ##
## ##
######################################################
# > galaxy.ansible.com/ui/repo/published/l3d/time/ < #
driftfile {{ ntp_driftfile }}
{% if ntp_leap %}
# Leap seconds definition provided by tzdata
leapfile {{ ntp_leapfile }}
{% endif %}
{% for restrict_ip in ntp_restrict %}
restrict {{ restrict_ip }}
{% endfor %}
@ -17,5 +22,13 @@ server {{ pool_server }}
{% endfor %}
{% if ntp_statistics | bool %}
statistics clockstats cryptostats loopstats peerstats
statistics {{ ntp_statistics_overview | join(' ') }}
# Enable this if you want statistics to be logged.
statsdir {{ ntp_ntpstats_dir }}
{% for stat in ntp_statistics_overview %}
filegen {{ stat }} file {{ stat }} type day enable
{% endfor %}
{% endif %}

View file

@ -1,8 +1,10 @@
---
ntp_package: ntp
ntp_package: 'ntpsec'
ntp_package_absent: 'ntp'
ntp_service: ntpd
ntp_user: 'ntpsec'
ntp_configfile: /etc/ntp.conf
ntp_configfile: /etc/ntpsec/ntp.conf
ntp_configfile_user: root
ntp_configfile_group: root
ntp_driftfile: /var/lib/ntp/drift

View file

@ -1,6 +1,8 @@
---
ntp_package:
ntp_package: ntp
ntp_service: ntp
ntp_package_absent: []
ntp_user: 'ntp'
ntp_configfile: /private/etc/ntp.conf
ntp_configfile_user: root

View file

@ -1,8 +1,10 @@
---
ntp_package: ntp
ntp_service: ntp
ntp_package: 'ntpsec'
ntp_package_absent: 'ntp'
ntp_service: 'ntpsec'
ntp_user: 'ntpsec'
ntp_configfile: /etc/ntp.conf
ntp_configfile: '/etc/ntpsec/ntp.conf'
ntp_configfile_user: root
ntp_configfile_group: root
ntp_driftfile: /var/lib/ntp/drift

View file

@ -1,6 +1,8 @@
---
ntp_package: ntp
ntp_package_absent: []
ntp_service: ntpd
ntp_user: 'ntp'
ntp_configfile: /etc/ntp.conf
ntp_configfile_user: root

View file

@ -1,6 +1,8 @@
---
ntp_package: net-misc/ntp
ntp_package_absent: []
ntp_service: ntp-client
ntp_user: 'ntp'
ntp_configfile: /etc/ntp.conf
ntp_configfile_user: root

View file

@ -1,6 +1,8 @@
---
ntp_package: ntp
ntp_package_absent: []
ntp_service: ntpd
ntp_user: 'ntp'
ntp_configfile: /etc/ntp.conf
ntp_configfile_user: root

View file

@ -1,6 +1,8 @@
---
ntp_package: ntp
ntp_package_absent: []
ntp_service: ntpd
ntp_user: 'ntp'
ntp_configfile: /etc/ntp.conf
ntp_configfile_user: root

View file

@ -1,6 +1,8 @@
---
ntp_package: ntp
ntp_package_absent: []
ntp_service: ntpd
ntp_user: 'ntp'
ntp_configfile: /etc/ntp.conf
ntp_configfile_user: root

View file

@ -1,6 +1,8 @@
---
ntp_package: ntp
ntp_package_absent: []
ntp_service: ntp
ntp_user: 'ntp'
ntp_configfile: /etc/ntp.conf
ntp_configfile_user: root

View file

@ -1,5 +1,5 @@
---
playbook_version_number: 2060
playbook_version_number: 2062
ntp__playbook_version_path: 'role-ntp_chaos-bodensee_github.com.version'
ntp__vars: