forked from CCCHH/ansible-infra
Vendor Galaxy Roles and Collections
This commit is contained in:
parent
c1e1897cda
commit
2aed20393f
3553 changed files with 387444 additions and 2 deletions
44
ansible_collections/debops/debops/roles/ntp/tasks/main.yml
Normal file
44
ansible_collections/debops/debops/roles/ntp/tasks/main.yml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
# Copyright (C) 2014-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
# Copyright (C) 2015-2017 Robin Schneider <ypid@riseup.net>
|
||||
# Copyright (C) 2014-2017 DebOps <https://debops.org/>
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
- name: Import DebOps global handlers
|
||||
ansible.builtin.import_role:
|
||||
name: 'global_handlers'
|
||||
|
||||
- name: Ensure that configuration is supported
|
||||
ansible.builtin.assert:
|
||||
that: not ntp__daemon or ntp__daemon in [ 'chrony', 'ntpd', 'ntpdate', 'openntpd', 'systemd-timesyncd' ]
|
||||
|
||||
- name: Ensure that alternative daemons/programs are not installed
|
||||
ansible.builtin.apt:
|
||||
name: '{{ ntp__purge_packages | flatten }}'
|
||||
state: 'absent'
|
||||
purge: True
|
||||
register: ntp__register_apt_purge
|
||||
until: ntp__register_apt_purge is succeeded
|
||||
when: ntp__daemon_enabled | bool
|
||||
|
||||
# Installs either ntpdate, NTPd, chrony or OpenNTPd on all hosts except inside containers
|
||||
- name: Install NTP service
|
||||
ansible.builtin.include_tasks: install.yml
|
||||
when: ntp__daemon_enabled | bool
|
||||
|
||||
- name: Make sure that Ansible local facts directory exists
|
||||
ansible.builtin.file:
|
||||
path: '/etc/ansible/facts.d'
|
||||
state: 'directory'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0755'
|
||||
|
||||
- name: Save ntp local facts
|
||||
ansible.builtin.template:
|
||||
src: 'etc/ansible/facts.d/ntp.fact.j2'
|
||||
dest: '/etc/ansible/facts.d/ntp.fact'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0644'
|
||||
tags: [ 'meta::facts' ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue