From 75aa51d0bb39b31ca017586f59e76f33e71ff661 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Tue, 5 Apr 2016 10:33:55 +0200 Subject: [PATCH] Fix ntp role issues with included handlers. --- roles/ntp/handlers/Debian.yml | 5 ----- roles/ntp/handlers/FreeBSD.yml | 5 ----- roles/ntp/handlers/main.yml | 10 ++++------ roles/ntp/tasks/Debian.yml | 3 --- roles/ntp/tasks/FreeBSD.yml | 4 +--- roles/ntp/tasks/main.yml | 1 - 6 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 roles/ntp/handlers/Debian.yml delete mode 100644 roles/ntp/handlers/FreeBSD.yml diff --git a/roles/ntp/handlers/Debian.yml b/roles/ntp/handlers/Debian.yml deleted file mode 100644 index 4b0629e..0000000 --- a/roles/ntp/handlers/Debian.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -- name: Restart ntp - service: name=ntp state=restarted - tags: ntp diff --git a/roles/ntp/handlers/FreeBSD.yml b/roles/ntp/handlers/FreeBSD.yml deleted file mode 100644 index 0a437dd..0000000 --- a/roles/ntp/handlers/FreeBSD.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -- name: Restart ntp - service: name=ntpd state=restarted - tags: ntp diff --git a/roles/ntp/handlers/main.yml b/roles/ntp/handlers/main.yml index ae3bb58..b4bf1ca 100644 --- a/roles/ntp/handlers/main.yml +++ b/roles/ntp/handlers/main.yml @@ -1,9 +1,7 @@ --- -- name: Debian - include: Debian.yml - when: ansible_os_family == 'Debian' +- name: Restart ntp + service: name=ntp state=restarted -- name: FreeBSD - include: FreeBSD.yml - when: ansible_distribution == 'FreeBSD' +- name: Restart ntpd + service: name=ntpd state=restarted diff --git a/roles/ntp/tasks/Debian.yml b/roles/ntp/tasks/Debian.yml index 9850550..b113021 100644 --- a/roles/ntp/tasks/Debian.yml +++ b/roles/ntp/tasks/Debian.yml @@ -2,13 +2,10 @@ - name: Install ntp apt: name=ntp state=present - tags: ntp - name: Configure ntp template: src=ntp.conf.j2 dest=/etc/ntp.conf notify: Restart ntp - tags: ntp - name: Start the ntp service service: name=ntp state=started enabled=yes - tags: ntp diff --git a/roles/ntp/tasks/FreeBSD.yml b/roles/ntp/tasks/FreeBSD.yml index 6b0652b..da2f02f 100644 --- a/roles/ntp/tasks/FreeBSD.yml +++ b/roles/ntp/tasks/FreeBSD.yml @@ -4,9 +4,7 @@ - name: Configure ntp template: src=ntp.conf.j2 dest=/etc/ntp.conf - notify: Restart ntp - tags: ntp + notify: Restart ntpd - name: Start the ntp service service: name=ntpd state=started enabled=yes - tags: ntp diff --git a/roles/ntp/tasks/main.yml b/roles/ntp/tasks/main.yml index b87264d..ae3bb58 100644 --- a/roles/ntp/tasks/main.yml +++ b/roles/ntp/tasks/main.yml @@ -1,5 +1,4 @@ --- -# This playbook contains common plays that will be run on all nodes. - name: Debian include: Debian.yml