Created
November 8, 2016 13:38
-
-
Save lanky/562012e15a2b7f68fd5efe3760a830d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# failed_when is off because you want the var to register even if there are no matching files in /etc/init.d | |
- name: Get startup file list | |
shell: grep -l kiwix-serve /etc/init.d/* | |
register: startup_file_list | |
failed_when: no | |
# basename gives the filename of the init script, the 'service' module will find it | |
- name: Stop running kiwix service | |
service: | |
name: "{{ item | basename }}" | |
state: stopped | |
with_items: "{{ startup_file_list.stdout_lines }|default(omit)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment