lint: add changed_when to command

Calling command should have changed_when false otherwise each time it
runs it will show as 'changed' and this is irrelevant.
Commands should not change things if nothing needs doing

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/3285/head
Sébastien Han 2018-10-30 15:51:32 +01:00 committed by Guillaume Abrioux
parent 7dab5d4ac2
commit 53972ee672
10 changed files with 19 additions and 3 deletions

View File

@ -19,6 +19,7 @@
- name: test existing initial mon keyring
command: ceph --connect-timeout 3 --cluster {{ cluster }} --keyring /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring -n mon. fsid
changed_when: false
register: test_initial_monitor_keyring
ignore_errors: true

View File

@ -188,6 +188,7 @@
- name: "inspecting {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} image after pulling"
command: "docker inspect {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
changed_when: false
failed_when: false
register: image_inspect_after_pull
@ -295,6 +296,8 @@
- (ceph_docker_dev_image is defined and ceph_docker_dev_image)
- name: remove tmp ceph dev image file
command: "rm /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
file:
name: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
state: absent
when:
- (ceph_docker_dev_image is defined and ceph_docker_dev_image)

View File

@ -65,6 +65,7 @@
- name: wait for mds socket to exist
command: "{{ docker_exec_cmd }} sh -c 'stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_hostname }}.asok || stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_fqdn }}.asok'"
changed_when: false
register: multi_mds_socket
retries: 5
delay: 15

View File

@ -18,6 +18,7 @@
- name: get enabled modules from ceph-mgr
command: "{{ docker_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} --format json mgr module ls"
changed_when: false
register: _ceph_mgr_modules
delegate_to: "{{ groups[mon_group_name][0] }}"

View File

@ -11,6 +11,7 @@
- name: wait for monitor socket to exist
command: "{{ docker_exec_cmd }} sh -c 'stat /var/run/ceph/{{ cluster }}-mon.{{ ansible_hostname }}.asok || stat /var/run/ceph/{{ cluster }}-mon.{{ ansible_fqdn }}.asok'"
changed_when: false
register: monitor_socket
retries: 5
delay: 15

View File

@ -1,11 +1,13 @@
---
- name: collect all the pools
command: rados --cluster {{ cluster }} lspools
changed_when: false
register: ceph_pools
check_mode: no
- name: secure the cluster
command: ceph --cluster {{ cluster }} osd pool set {{ item[0] }} {{ item[1] }} true
changed_when: false
with_nested:
- "{{ ceph_pools.stdout_lines|default([]) }}"
- "{{ secure_cluster_flags }}"

View File

@ -6,6 +6,7 @@
register: wait_for_all_osds_up
retries: 30
delay: 10
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
until: wait_for_all_osds_up.rc == 0

View File

@ -1,3 +1,4 @@
---
- name: add a peer
shell: "rbd mirror pool peer add {{ ceph_rbd_mirror_pool }} {{ ceph_rbd_mirror_remote_user }}@{{ ceph_rbd_mirror_remote_cluster }}"
command: "rbd mirror pool peer add {{ ceph_rbd_mirror_pool }} {{ ceph_rbd_mirror_remote_user }}@{{ ceph_rbd_mirror_remote_cluster }}"
changed_when: false

View File

@ -15,11 +15,13 @@
- name: set default realm
command: "{{ docker_exec_cmd }} radosgw-admin realm default --rgw-realm={{ rgw_realm }}"
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
- name: set default zonegroup
command: "{{ docker_exec_cmd }} radosgw-admin zonegroup default --rgw-zonegroup={{ rgw_zonegroup }}"
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true

View File

@ -23,6 +23,9 @@
- name: create nss entries for keystone certificates
shell: "{{ item }}"
args:
warn: no
changed_when: false
with_items:
- "openssl x509 -in /etc/keystone/ssl/certs/ca.pem -pubkey | certutil -d {{ radosgw_nss_db_path }} -A -n ca -t 'TCu,Cu,Tuw'"
- "openssl x509 -in /etc/keystone/ssl/certs/signing_cert.pem -pubkey | certutil -A -d {{ radosgw_nss_db_path }} -n signing_cert -t 'P,P,P'"