Integrate "Manage services" to the handler

This commit is contained in:
Jeremy Gardais 2018-02-27 15:51:44 +01:00
parent 6cb121a5ea
commit 4a51da3a96
2 changed files with 1 additions and 10 deletions

View File

@ -4,6 +4,7 @@
service: service:
name: '{{ "flexlm-" + item.name }}' name: '{{ "flexlm-" + item.name }}'
state: '{{ "restarted" if (flexlm__deploy_state == "present" and (item.service | d(True)) else "stopped" }}' state: '{{ "restarted" if (flexlm__deploy_state == "present" and (item.service | d(True)) else "stopped" }}'
enabled: '{{ item.service | d(True) | bool }}'
with_flattened: with_flattened:
- '{{ flexlm__licences }}' - '{{ flexlm__licences }}'

View File

@ -79,7 +79,6 @@
group: 'root' group: 'root'
mode: '0644' mode: '0644'
register: flexlm__register_service register: flexlm__register_service
notify: ['restart flexlm services']
with_flattened: with_flattened:
- '{{ flexlm__licences }}' - '{{ flexlm__licences }}'
when: ( (flexlm__deploy_state == "present") and when: ( (flexlm__deploy_state == "present") and
@ -90,7 +89,6 @@
dest: '{{ "/etc/systemd/system/flexlm-" + item.name + ".service" }}' dest: '{{ "/etc/systemd/system/flexlm-" + item.name + ".service" }}'
state: absent state: absent
register: flexlm__register_service register: flexlm__register_service
notify: ['restart flexlm services']
with_flattened: with_flattened:
- '{{ flexlm__licences }}' - '{{ flexlm__licences }}'
when: ( (flexlm__deploy_state == "absent") or when: ( (flexlm__deploy_state == "absent") or
@ -101,11 +99,3 @@
notify: ['restart flexlm services'] notify: ['restart flexlm services']
when: ( flexlm__register_service|changed ) when: ( flexlm__register_service|changed )
- name: Manage services
service:
name: '{{ "flexlm-" + item.name }}'
state: '{{ "started" if (flexlm__deploy_state == "present" and (item.service | d(True)) else "stopped" }}'
enabled: '{{ item.service | d(True) | bool }}'
with_flattened:
- '{{ flexlm__licences }}'