diff --git a/tasks/main.yml b/tasks/main.yml index aac6502..a23b050 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -208,6 +208,7 @@ vars: cluster_hostname: "{{ hostvars[inventory_hostname][cluster_hostname_fact] }}" command: pcs cluster node add-remote {{ cluster_hostname }} + changed_when: true when: - cluster_node_is_remote | bool - (pcs_status.stdout | regex_search('\\b' ~ cluster_hostname ~ '\\s+\\(ocf::pacemaker:remote\\)') or '') | length == 0 diff --git a/tasks/redhat_repos.yml b/tasks/redhat_repos.yml index 7f5a626..0082ee8 100644 --- a/tasks/redhat_repos.yml +++ b/tasks/redhat_repos.yml @@ -11,6 +11,7 @@ command: >- subscription-manager repos --enable="rhel-{{ repos_type }}-for-rhel-{{ ansible_distribution_major_version }}-server-rpms" + changed_when: true when: >- ['rhel-',repos_type,'-for-rhel-',ansible_distribution_major_version,'-server-rpms'] | join not in yum_repolist.stdout @@ -21,6 +22,7 @@ command: >- subscription-manager repos --enable="rhel-{{ repos_type }}-for-rhel-{{ ansible_distribution_major_version }}-server-eus-rpms" + changed_when: true when: >- ['rhel-',repos_type,'-for-rhel-',ansible_distribution_major_version,'-server-eus-rpms'] | join not in yum_repolist.stdout @@ -31,6 +33,7 @@ command: >- subscription-manager repos --enable="rhel-ha-for-rhel-{{ ansible_distribution_major_version }}-server-e4s-rpms" + changed_when: true when: >- ['rhel-',repos_type,'-for-rhel-',ansible_distribution_major_version,'-server-e4s-rpms'] | join not in yum_repolist.stdout @@ -41,6 +44,7 @@ command: >- subscription-manager repos --enable="rhel-{{ repos_type }}-for-rhel-{{ ansible_distribution_major_version }}-server-beta-rpms" + changed_when: true when: >- ['rhel-',repos_type,'-for-rhel-',ansible_distribution_major_version,'-server-beta-rpms'] | join not in yum_repolist.stdout @@ -51,6 +55,7 @@ command: >- subscription-manager repos --enable="rhel-{{ ansible_distribution_major_version }}-for-x86_64-{{ (repos_type == 'rs') | ternary('resilientstorage', 'highavailability') }}-rpms" + changed_when: true when: >- ['rhel-',ansible_distribution_major_version,'-for-x86_64-',(repos_type == 'rs') | ternary( 'resilientstorage', 'highavailability'),'-rpms'] | join not in yum_repolist.stdout @@ -59,4 +64,5 @@ - name: Enable single custom repository command: subscription-manager repos --enable="{{ custom_repository }}" + changed_when: true when: "custom_repository is defined and custom_repository not in yum_repolist.stdout|default(custom_repository)"