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
|
# handlers file for ansible-role-ntp
|
||||||
|
|
||||||
- name: Restart ntp daemons on Linux
|
- name: Restart ntp daemons on Linux
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: "{{ ntp_service }}"
|
name: "{{ ntp_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: Restart ntp daemons on FreeBSD
|
- name: Restart ntp daemons on FreeBSD
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: "{{ ntp_service }}"
|
name: "{{ ntp_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: Restart ntp daemons on OpenBSD
|
- name: Restart ntp daemons on OpenBSD
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: "{{ ntp_service }}"
|
name: "{{ ntp_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# Tasks file for config ntp daemon
|
# Tasks file for config ntp daemon
|
||||||
|
|
||||||
- name: seting-up ntp config
|
- name: seting-up ntp config
|
||||||
|
become: yes
|
||||||
template:
|
template:
|
||||||
src: ntp.conf.j2
|
src: ntp.conf.j2
|
||||||
dest: "{{ ntp_configfile }}"
|
dest: "{{ ntp_configfile }}"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# Tasks file for install ntp daemon on MacOSX system
|
# Tasks file for install ntp daemon on MacOSX system
|
||||||
|
|
||||||
- name: Service ntp on MacOSX
|
- name: Service ntp on MacOSX
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: "{{ ntp_service }}"
|
name: "{{ ntp_service }}"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
# Tasks file for install ntp daemon on FreeBSD system
|
# Tasks file for install ntp daemon on FreeBSD system
|
||||||
|
|
||||||
- name: Install ntp daemon on FreeBSD
|
- name: Install ntp daemon on FreeBSD
|
||||||
|
become: yes
|
||||||
package:
|
package:
|
||||||
name: "{{ ntp_package }}"
|
name: "{{ ntp_package }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Service ntp on FreeBSD
|
- name: Service ntp on FreeBSD
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: "{{ ntp_service }}"
|
name: "{{ ntp_service }}"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
|
@ -2,22 +2,26 @@
|
||||||
# Tasks file for install ntp daemon on Linux system
|
# Tasks file for install ntp daemon on Linux system
|
||||||
|
|
||||||
- name: Update apt cache on Debian Family os
|
- name: Update apt cache on Debian Family os
|
||||||
|
become: yes
|
||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_os_family == "Debian"
|
||||||
|
|
||||||
- name: Update emerge cache on Gentoo
|
- name: Update emerge cache on Gentoo
|
||||||
|
become: yes
|
||||||
shell: emerge-webrsync
|
shell: emerge-webrsync
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: ansible_os_family == "Gentoo"
|
when: ansible_os_family == "Gentoo"
|
||||||
|
|
||||||
- name: Install ntp daemon on Linux
|
- name: Install ntp daemon on Linux
|
||||||
|
become: yes
|
||||||
package:
|
package:
|
||||||
name: "{{ ntp_package }}"
|
name: "{{ ntp_package }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Service ntp on Linux
|
- name: Service ntp on Linux
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: "{{ ntp_service }}"
|
name: "{{ ntp_service }}"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
# Tasks file for install ntp daemon on OpenBSD system
|
# Tasks file for install ntp daemon on OpenBSD system
|
||||||
|
|
||||||
- name: Install ntp daemon on OpenBSD
|
- name: Install ntp daemon on OpenBSD
|
||||||
|
become: yes
|
||||||
package:
|
package:
|
||||||
name: "{{ ntp_package }}"
|
name: "{{ ntp_package }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Service ntp on OpenBSD
|
- name: Service ntp on OpenBSD
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: "{{ ntp_service }}"
|
name: "{{ ntp_service }}"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
Loading…
Reference in a new issue