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

Run commands as admin

This commit is contained in:
Lilian Roller 2019-03-04 17:35:28 +01:00
parent 5cb68947b4
commit 2e5e42f2df
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
6 changed files with 13 additions and 0 deletions

View file

@ -2,16 +2,19 @@
# handlers file for ansible-role-ntp
- name: Restart ntp daemons on Linux
become: yes
service:
name: "{{ ntp_service }}"
state: restarted
- name: Restart ntp daemons on FreeBSD
become: yes
service:
name: "{{ ntp_service }}"
state: restarted
- name: Restart ntp daemons on OpenBSD
become: yes
service:
name: "{{ ntp_service }}"
state: restarted

View file

@ -2,6 +2,7 @@
# Tasks file for config ntp daemon
- name: seting-up ntp config
become: yes
template:
src: ntp.conf.j2
dest: "{{ ntp_configfile }}"

View file

@ -2,6 +2,7 @@
# Tasks file for install ntp daemon on MacOSX system
- name: Service ntp on MacOSX
become: yes
service:
name: "{{ ntp_service }}"
enabled: yes

View file

@ -2,11 +2,13 @@
# Tasks file for install ntp daemon on FreeBSD system
- name: Install ntp daemon on FreeBSD
become: yes
package:
name: "{{ ntp_package }}"
state: present
- name: Service ntp on FreeBSD
become: yes
service:
name: "{{ ntp_service }}"
enabled: yes

View file

@ -2,22 +2,26 @@
# Tasks file for install ntp daemon on Linux system
- name: Update apt cache on Debian Family os
become: yes
apt:
update_cache: yes
changed_when: false
when: ansible_os_family == "Debian"
- name: Update emerge cache on Gentoo
become: yes
shell: emerge-webrsync
changed_when: false
when: ansible_os_family == "Gentoo"
- name: Install ntp daemon on Linux
become: yes
package:
name: "{{ ntp_package }}"
state: present
- name: Service ntp on Linux
become: yes
service:
name: "{{ ntp_service }}"
enabled: yes

View file

@ -2,11 +2,13 @@
# Tasks file for install ntp daemon on OpenBSD system
- name: Install ntp daemon on OpenBSD
become: yes
package:
name: "{{ ntp_package }}"
state: present
- name: Service ntp on OpenBSD
become: yes
service:
name: "{{ ntp_service }}"
enabled: yes