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:
parent
5cb68947b4
commit
2e5e42f2df
6 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 }}"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue