-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from pavel-z1/master
Remove ignore_errors for Disable services tasks
- Loading branch information
Showing
4 changed files
with
80 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Set variable with services List for CentOS 6 | ||
command: chkconfig --list # noqa 303 | ||
register: __timesync_register_services | ||
check_mode: no | ||
changed_when: false | ||
|
||
- name: Set variable `timesync_services` with filtered uniq service names | ||
set_fact: | ||
timesync_services: | | ||
{{ __timesync_register_services.stdout_lines | | ||
map('regex_replace', '[ \t].*$', '') | | ||
unique | | ||
list }} | ||
when: __timesync_register_services is defined |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Set variable with services List for RedHat 6 | ||
command: chkconfig --list # noqa 303 | ||
register: __timesync_register_services | ||
check_mode: no | ||
changed_when: false | ||
|
||
- name: Set variable `timesync_services` with filtered uniq service names | ||
set_fact: | ||
timesync_services: | | ||
{{ __timesync_register_services.stdout_lines | | ||
map('regex_replace', '[ \t].*$', '') | | ||
unique | | ||
list }} | ||
when: __timesync_register_services is defined |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
- name: Set variable with services List for RedHat 7 and above systems | ||
command: systemctl list-unit-files --no-legend *.service # noqa 303 | ||
register: __timesync_register_services | ||
check_mode: no | ||
changed_when: false | ||
|
||
- name: Set variable `timesync_services` with filtered uniq service names | ||
set_fact: | ||
timesync_services: | | ||
{{ __timesync_register_services.stdout_lines | | ||
map('regex_replace', '[.]service.*$', '') | | ||
map('regex_replace', '@$', '') | | ||
unique | | ||
list }} | ||
when: __timesync_register_services is defined |