Use check_mode instead of always_run

This patch changes the `always_run: yes` task option to
`check_mode: no` to avoid Ansible warnings.
pull/2105/head
Major Hayden 2017-10-25 09:53:34 -05:00
parent c2b5118c1b
commit f73232caa4
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
41 changed files with 82 additions and 82 deletions

View File

@ -3,7 +3,7 @@
raw: stat $HOME/.python
register: need_python
ignore_errors: true
always_run: true
check_mode: no
- include: install_pypy.yml
when: need_python | failed
@ -12,7 +12,7 @@
raw: stat $HOME/.pip
register: need_pip
ignore_errors: true
always_run: true
check_mode: no
- include: install_pip.yml
when: need_pip | failed and need_python | failed

View File

@ -5,7 +5,7 @@
failed_when: false
register: nmapexist
run_once: true
always_run: true
check_mode: no
- name: inform that nmap is not present
debug:
@ -19,7 +19,7 @@
changed_when: false
failed_when: false
register: monportstate
always_run: true
check_mode: no
when:
- mon_group_name in group_names
- nmapexist.rc == 0
@ -37,7 +37,7 @@
changed_when: false
failed_when: false
register: osdrangestate
always_run: true
check_mode: no
when:
- osd_group_name in group_names
- nmapexist.rc == 0
@ -55,7 +55,7 @@
changed_when: false
failed_when: false
register: mdsrangestate
always_run: true
check_mode: no
when:
- mds_group_name in group_names
- nmapexist.rc == 0
@ -73,7 +73,7 @@
changed_when: false
failed_when: false
register: rgwportstate
always_run: true
check_mode: no
when:
- rgw_group_name in group_names
- nmapexist.rc == 0
@ -91,7 +91,7 @@
changed_when: false
failed_when: false
register: nfsportstate
always_run: true
check_mode: no
when:
- nfs_group_name in group_names
- nmapexist.rc == 0

View File

@ -30,7 +30,7 @@
register: subscription
changed_when: false
failed_when: false
always_run: true
check_mode: no
when:
- ansible_distribution == 'Red Hat Enterprise Linux'
- ceph_repository == 'rhcs'

View File

@ -23,7 +23,7 @@
stat:
path: /etc/default/ceph
register: etc_default_ceph
always_run: true
check_mode: no
when:
- ansible_os_family == "Debian"

View File

@ -4,7 +4,7 @@
changed_when: false
failed_when: false
register: rhcs_mon_repo
always_run: true
check_mode: no
when:
- mon_group_name in group_names
@ -20,7 +20,7 @@
changed_when: false
failed_when: false
register: rhcs_osd_repo
always_run: true
check_mode: no
when:
- osd_group_name in group_names
@ -36,7 +36,7 @@
changed_when: false
failed_when: false
register: rhcs_rgw_mds_nfs_repo
always_run: true
check_mode: no
when:
- (rgw_group_name in group_names or mds_group_name in group_names or nfs_group_name in group_names)

View File

@ -57,7 +57,7 @@
- name: get ceph version
command: ceph --version
changed_when: false
always_run: yes
check_mode: no
register: ceph_version
- name: set_fact ceph_version

View File

@ -33,7 +33,7 @@
command: sysctl -b vm.min_free_kbytes
changed_when: false
failed_when: false
always_run: yes
check_mode: no
register: default_vm_min_free_kbytes
- name: set_fact vm_min_free_kbytes

View File

@ -88,7 +88,7 @@
removes="{{ fetch_directory }}/ceph_cluster_uuid.conf"
changed_when: false
register: cluster_uuid
always_run: true
check_mode: no
become: false
when:
- generate_fsid

View File

@ -4,7 +4,7 @@
register: ceph_mon_container_stat
changed_when: false
failed_when: false
always_run: true
check_mode: no
when:
- inventory_hostname in groups.get(mon_group_name, [])
@ -13,7 +13,7 @@
register: ceph_osd_container_stat
changed_when: false
failed_when: false
always_run: true
check_mode: no
when:
- inventory_hostname in groups.get(osd_group_name, [])
@ -22,7 +22,7 @@
register: ceph_mds_container_stat
changed_when: false
failed_when: false
always_run: true
check_mode: no
when:
- inventory_hostname in groups.get(mds_group_name, [])
@ -31,7 +31,7 @@
register: ceph_rgw_container_stat
changed_when: false
failed_when: false
always_run: true
check_mode: no
when:
- inventory_hostname in groups.get(rgw_group_name, [])
@ -40,7 +40,7 @@
register: ceph_mgr_container_stat
changed_when: false
failed_when: false
always_run: true
check_mode: no
when:
- inventory_hostname in groups.get(mgr_group_name, [])
@ -49,7 +49,7 @@
register: ceph_rbd_mirror_container_stat
changed_when: false
failed_when: false
always_run: true
check_mode: no
when:
- inventory_hostname in groups.get(rbdmirror_group_name, [])
@ -58,6 +58,6 @@
register: ceph_nfs_container_stat
changed_when: false
failed_when: false
always_run: true
check_mode: no
when:
- inventory_hostname in groups.get(nfs_group_name, [])

View File

@ -3,7 +3,7 @@
shell: stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mon*.asok
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: mon_socket_stat
when:
- inventory_hostname in groups.get(mon_group_name, [])
@ -12,7 +12,7 @@
command: fuser --silent {{ mon_socket_stat.stdout }}
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: mon_socket
when:
- inventory_hostname in groups.get(mon_group_name, [])
@ -32,7 +32,7 @@
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-osd*.asok
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: osd_socket_stat
when:
- inventory_hostname in groups.get(osd_group_name, [])
@ -41,7 +41,7 @@
command: fuser --silent {{ osd_socket_stat.stdout }}
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: osd_socket
when:
- inventory_hostname in groups.get(osd_group_name, [])
@ -61,7 +61,7 @@
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mds*.asok
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: mds_socket_stat
when:
- inventory_hostname in groups.get(mds_group_name, [])
@ -70,7 +70,7 @@
command: fuser --silent {{ mds_socket_stat.stdout }}
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: mds_socket
when:
- inventory_hostname in groups.get(mds_group_name, [])
@ -90,7 +90,7 @@
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-client.rgw*.asok
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: rgw_socket_stat
when:
- inventory_hostname in groups.get(rgw_group_name, [])
@ -99,7 +99,7 @@
command: fuser --silent {{ rgw_socket_stat.stdout }}
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: rgw_socket
when:
- inventory_hostname in groups.get(rgw_group_name, [])
@ -119,7 +119,7 @@
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mgr*.asok
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: mgr_socket_stat
when:
- inventory_hostname in groups.get(mgr_group_name, [])
@ -128,7 +128,7 @@
command: fuser --silent {{ mgr_socket_stat.stdout }}
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: mgr_socket
when:
- inventory_hostname in groups.get(mgr_group_name, [])
@ -148,7 +148,7 @@
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-client.rbd-mirror*.asok
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: rbd_mirror_socket_stat
when:
- inventory_hostname in groups.get(rbdmirror_group_name, [])
@ -157,7 +157,7 @@
command: fuser --silent {{ rbd_mirror_socket_stat.stdout }}
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: rbd_mirror_socket
when:
- inventory_hostname in groups.get(rbdmirror_group_name, [])
@ -176,7 +176,7 @@
command: stat --printf=%n /var/run/ganesha.pid
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: nfs_socket_stat
when:
- inventory_hostname in groups.get(nfs_group_name, [])
@ -185,7 +185,7 @@
command: fuser --silent {{ nfs_socket_stat.stdout }}
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: nfs_socket
when:
- inventory_hostname in groups.get(nfs_group_name, [])

View File

@ -18,7 +18,7 @@
command: "{{ docker_exec_cmd }} ceph --connect-timeout 3 --cluster {{ cluster }} fsid"
changed_when: false
failed_when: false
always_run: yes
check_mode: no
register: ceph_current_fsid
delegate_to: "{{ groups[mon_group_name][0] }}"
when:
@ -82,7 +82,7 @@
changed_when: false
register: cluster_uuid
become: false
always_run: true
check_mode: no
when:
- generate_fsid

View File

@ -5,5 +5,5 @@
warn: no
register: ntp_pkg_query
ignore_errors: true
always_run: true
check_mode: no
changed_when: false

View File

@ -3,7 +3,7 @@
command: dpkg -s ntp
register: ntp_pkg_query
ignore_errors: true
always_run: true
check_mode: no
changed_when: false
when:
- ansible_os_family == 'Debian'

View File

@ -5,7 +5,7 @@
warn: no
register: ntp_pkg_query
ignore_errors: true
always_run: true
check_mode: no
changed_when: false
when:
- ansible_os_family == 'RedHat'

View File

@ -9,7 +9,7 @@
stat:
path: /run/ostree-booted
register: stat_ostree
always_run: true
check_mode: no
- name: set_fact is_atomic
set_fact:
@ -38,7 +38,7 @@
- name: get docker version
command: docker --version
changed_when: false
always_run: yes
check_mode: no
register: docker_version
- name: set_fact docker_version docker_version.stdout.split
@ -56,7 +56,7 @@
register: ceph_health
changed_when: false
failed_when: false
always_run: true
check_mode: no
- name: include checks.yml
include: checks.yml
@ -96,7 +96,7 @@
- name: get ceph version
command: docker run --entrypoint /usr/bin/ceph {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} --version
changed_when: false
always_run: yes
check_mode: no
register: ceph_version
- name: set_fact ceph_version ceph_version.stdout.split

View File

@ -3,4 +3,4 @@
command: getenforce
register: sestatus
changed_when: false
always_run: true
check_mode: no

View File

@ -34,5 +34,5 @@
become: false
failed_when: false
register: statconfig
always_run: true
check_mode: no

View File

@ -3,7 +3,7 @@
shell: ls -1 /etc/ceph/*.keyring
changed_when: false
register: ceph_keys
always_run: true
check_mode: no
- name: set keys permissions
file:

View File

@ -12,7 +12,7 @@
with_items: "{{ crt_files }}"
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: crt_files_exist
- name: try to fetch crt file(s)

View File

@ -14,7 +14,7 @@
changed_when: false
become: false
failed_when: false
always_run: true
check_mode: no
register: statconfig
- name: try to fetch ceph config and keys

View File

@ -11,7 +11,7 @@
changed_when: false
become: false
failed_when: false
always_run: true
check_mode: no
register: statconfig
- name: try to fetch ceph config and keys
@ -30,7 +30,7 @@
- name: "copy mgr key to /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring"
command: cp /etc/ceph/{{ cluster }}.mgr.{{ ansible_hostname }}.keyring /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring
changed_when: false
always_run: true
check_mode: no
with_items: "{{ statconfig.results }}"
when: item.stat.exists == true

View File

@ -4,7 +4,7 @@
args:
creates: /etc/ceph/{{ cluster }}.client.admin.keyring
changed_when: false
always_run: true
check_mode: no
when:
- cephx
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
@ -12,7 +12,7 @@
- name: collect admin and bootstrap keys
command: ceph-create-keys --cluster {{ cluster }} -i {{ monitor_name }}
changed_when: false
always_run: true
check_mode: no
when:
- cephx
- ceph_release_num[ceph_release] < ceph_release_num.luminous
@ -42,7 +42,7 @@
command: ceph --cluster {{ cluster }} config-key get initial_mon_keyring
changed_when: false
ignore_errors: true
always_run: true
check_mode: no
run_once: true
failed_when: false
register: is_initial_mon_keyring_in_kv
@ -50,7 +50,7 @@
- name: put initial mon keyring in mon kv store
command: ceph --cluster {{ cluster }} config-key put initial_mon_keyring {{ monitor_keyring.stdout }}
changed_when: false
always_run: true
check_mode: no
run_once: true
when:
- is_initial_mon_keyring_in_kv.rc != 0
@ -87,7 +87,7 @@
shell: ls -1 /etc/ceph/*.keyring
changed_when: false
register: ceph_keys
always_run: true
check_mode: no
when:
- cephx

View File

@ -12,7 +12,7 @@
changed_when: false
register: monitor_keyring
become: false
always_run: true
check_mode: no
when: cephx
- name: create monitor initial keyring

View File

@ -47,7 +47,7 @@
become: false
failed_when: false
register: statconfig
always_run: true
check_mode: no
- name: try to copy ceph config and keys
copy:

View File

@ -110,7 +110,7 @@
become: false
failed_when: false
register: stat_mgr_keys
always_run: true
check_mode: no
when:
- "{{ groups.get(mgr_group_name, []) | length > 0 }}"

View File

@ -2,7 +2,7 @@
- name: collect all the pools
command: rados --cluster {{ cluster }} lspools
register: ceph_pools
always_run: true
check_mode: no
- name: secure the cluster
command: ceph --cluster {{ cluster }} osd pool set {{ item[0] }} {{ item[1] }} true

View File

@ -4,7 +4,7 @@
register: selinuxstatus
changed_when: false
failed_when: false
always_run: true
check_mode: no
- name: install policycoreutils-python to get semanage
package:

View File

@ -10,7 +10,7 @@
changed_when: false
become: false
failed_when: false
always_run: true
check_mode: no
register: statconfig
- name: try to fetch config and keys

View File

@ -42,7 +42,7 @@
- "{{ dedicated_devices|unique }}"
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: journal_partition_status
when:
- osd_scenario == 'non-collocated'

View File

@ -5,7 +5,7 @@
- "{{ devices }}"
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: osd_partition_status_results
# NOTE: The following calls to sgdisk are retried because sgdisk is known to

View File

@ -15,7 +15,7 @@
changed_when: false
become: false
failed_when: false
always_run: true
check_mode: no
register: statconfig
- name: try to copy ceph config and keys

View File

@ -40,7 +40,7 @@
- "{{ devices }}"
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: parted_results
- name: include copy_configs.yml

View File

@ -4,7 +4,7 @@
with_items: "{{ devices }}"
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: osd_path
- name: get osd id
@ -12,7 +12,7 @@
with_items: "{{ osd_path.results }}"
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: osd_id_non_dir_scenario
# NOTE (leseb): we must do this because of

View File

@ -4,7 +4,7 @@
ls /var/lib/ceph/osd/ | sed 's/.*-//'
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: osd_id
until: osd_id.stdout_lines|length == devices|unique|length
retries: 10

View File

@ -17,7 +17,7 @@
changed_when: false
become: false
failed_when: false
always_run: true
check_mode: no
register: statconfig
when: "item | length > 0"

View File

@ -11,7 +11,7 @@
become: false
ignore_errors: true
register: statconfig
always_run: true
check_mode: no
- name: try to fetch ceph config and keys
copy:

View File

@ -3,7 +3,7 @@
shell: "pgrep -f ceph-rest-api"
changed_when: false
failed_when: false
always_run: true
check_mode: no
register: restapi_status
- name: start ceph rest api

View File

@ -10,7 +10,7 @@
changed_when: false
become: false
ignore_errors: true
always_run: true
check_mode: no
register: statconfig
- name: try to fetch ceph config and keys

View File

@ -4,25 +4,25 @@
register: realmcheck
failed_when: False
changed_when: False
always_run: True
check_mode: no
- name: check if the zonegroup already exists
command: radosgw-admin zonegroup get --rgw-zonegroup={{ rgw_zonegroup }}
register: zonegroupcheck
failed_when: False
changed_when: False
always_run: True
check_mode: no
- name: check if the zone already exists
command: radosgw-admin zone get --rgw-zone={{ rgw_zone }}
register: zonecheck
failed_when: False
changed_when: False
always_run: True
check_mode: no
- name: check if the system user already exists
command: radosgw-admin user info --uid=zone.user
register: usercheck
failed_when: False
changed_when: False
always_run: True
check_mode: no

View File

@ -53,7 +53,7 @@
stat:
path: /run/ostree-booted
register: stat_ostree
always_run: true
check_mode: no
- name: set fact for using Atomic host
set_fact:
@ -125,7 +125,7 @@
- name: set MTU on eth2
command: "ifconfig eth2 mtu 1400 up"
- hosts: mdss:rgws:clients
- hosts: mdss:rgws:clients
gather_facts: false
become: yes
tasks:

View File

@ -8,7 +8,7 @@
- name: check if it is Atomic host
stat: path=/run/ostree-booted
register: stat_ostree
always_run: true
check_mode: no
- name: set fact for using Atomic host
set_fact: