From 243cf0a145ec4226f0a068c4ea7c98fc4084a5b9 Mon Sep 17 00:00:00 2001 From: Fabian Freyer Date: Wed, 2 Nov 2016 16:03:24 +0100 Subject: [PATCH] Use check_mode instead of always_run always_run is being deprecated in ansible 2.4 --- tasks/main.yml | 6 +++--- tasks/site.yml | 8 ++++---- tasks/users.yml | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 16b84f9..8d64e21 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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: @@ -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' @@ -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 }}' diff --git a/tasks/site.yml b/tasks/site.yml index 5ae1cdb..de8efa4 100644 --- a/tasks/site.yml +++ b/tasks/site.yml @@ -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 }}' @@ -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] | @@ -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) diff --git a/tasks/users.yml b/tasks/users.yml index d9883cf..cfadcfe 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -11,7 +11,7 @@ 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' ] @@ -19,7 +19,7 @@ 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' ] @@ -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' ]