diff --git a/handlers/main.yml b/handlers/main.yml deleted file mode 100644 index 82fe945..0000000 --- a/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Reload consul - command: 'consul reload' - ignore_errors: True - tags: ['consul-service'] diff --git a/tasks/darwin.yml b/tasks/darwin.yml index 1a9ff55..dc40d84 100644 --- a/tasks/darwin.yml +++ b/tasks/darwin.yml @@ -23,6 +23,7 @@ changed_when: false - name: Reload consul - command: '/usr/local/bin/consul reload' + community.general.launchd: + name: 'consul' + state: 'restarted' when: consul_config.changed - changed_when: false diff --git a/tasks/linux.yml b/tasks/linux.yml index 1693345..d02c96a 100644 --- a/tasks/linux.yml +++ b/tasks/linux.yml @@ -22,6 +22,7 @@ changed_when: false - name: Reload consul - command: 'consul reload' + service: + name: 'consul' + state: 'reloaded' when: consul_config.changed - changed_when: false diff --git a/tasks/win32nt.yml b/tasks/win32nt.yml index 6b24406..b5d8bbe 100644 --- a/tasks/win32nt.yml +++ b/tasks/win32nt.yml @@ -16,6 +16,7 @@ changed_when: false - name: Reload consul - win_command: 'C:/consul/consul.exe reload' + win_service: + name: 'consul' + state: 'restarted' when: consul_config.changed - changed_when: false