Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use check_mode instead of always_run #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
register: checkmk_server_register_version
changed_when: False
failed_when: False
always_run: True
check_mode: yes

- name: Download Check_MK RAW package
get_url:
Expand Down Expand Up @@ -63,7 +63,7 @@
path: '/etc/apache2/mods-enabled/headers.load'
register: checkmk_server_register_mod_headers
changed_when: False
always_run: True
check_mode: yes

- name: Enable apache2 mod_headers
command: 'a2enmod headers'
Expand All @@ -75,7 +75,7 @@
path: '/etc/apache2/mods-enabled/ssl.load'
register: checkmk_server_register_mod_ssl
changed_when: False
always_run: True
check_mode: yes

- name: Enable apache2 mod_ssl
command: '{{ item }}'
Expand Down
8 changes: 4 additions & 4 deletions tasks/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
stat:
path: '/omd/versions/default'
register: checkmk_server_register_default
always_run: True
check_mode: no

- name: Set new default version
command: omd setversion '{{ checkmk_server__version_label }}'
Expand All @@ -23,13 +23,13 @@
command: omd version '{{ checkmk_server__site }}'
register: checkmk_server_register_site_version
changed_when: False
always_run: True
check_mode: no
ignore_errors: '{{ ansible_check_mode }}'

- name: Trigger site version update
set_fact:
checkmk_server__fact_update: True
always_run: True
check_mode: no
ignore_errors: '{{ ansible_check_mode }}'
when: checkmk_server__update|d(False)|bool and
((checkmk_server_register_site_version.stdout.split(" ")[-1] | splitext)[0] |
Expand All @@ -53,7 +53,7 @@
with_items: '{{ checkmk_server__runtime_config }}'
register: checkmk_server_register_runtime
changed_when: False
always_run: True
check_mode: no
ignore_errors: '{{ ansible_check_mode }}'

- name: Shutdown Check_MK site (if required)
Expand Down
6 changes: 3 additions & 3 deletions tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
command: 'sed -e "1,/^multisite_users\s*=/d" {{ checkmk_server__site_home }}/{{ checkmk_server__multisite_config_path }}/wato/users.mk'
register: checkmk_server__register_users_mk
changed_when: False
always_run: True
check_mode: no
ignore_errors: '{{ ansible_check_mode }}'
tags: [ 'role::checkmk_server:multisite' ]

- name: Read local contacts definition
command: 'sed -e "1,/^contacts.update(/d" -e "$d" {{ checkmk_server__site_home }}/{{ checkmk_server__site_config_path }}/wato/contacts.mk'
register: checkmk_server__register_contacts_mk
changed_when: False
always_run: True
check_mode: no
ignore_errors: '{{ ansible_check_mode }}'
tags: [ 'role::checkmk_server:multisite' ]

Expand All @@ -31,7 +31,7 @@
checkmk_server__fact_local_contacts: '{{ checkmk_server__register_contacts_mk.stdout
if checkmk_server__register_contacts_mk.stdout|length > 0
else {} }}'
always_run: True
check_mode: no
tags: [ 'role::checkmk_server:multisite' ]


Expand Down