Skip to content

Commit

Permalink
non-functional changes (ansible-lint): no-changed-when
Browse files Browse the repository at this point in the history
  • Loading branch information
OndrejHome committed Oct 22, 2023
1 parent 5b2a2a9 commit 1099d99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tasks/redhat_repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)"

0 comments on commit 1099d99

Please sign in to comment.