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 # 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

View file

@ -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 }}"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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