don't use "static" field while including tasks

Instead used "import_tasks" and "include_tasks" to tell whether tasks
must be included statically or dynamically.

Fixes: https://github.com/ceph/ceph-ansible/issues/2998
Signed-off-by: Rishabh Dave <ridave@redhat.com>
pull/3194/head
Rishabh Dave 2018-08-10 08:16:30 -04:00 committed by mergify[bot]
parent bae0f41705
commit b5d2ea269f
6 changed files with 60 additions and 118 deletions

View File

@ -6,6 +6,6 @@
- include_tasks: roles/ceph-rgw/tasks/multisite/destroy.yml - include_tasks: roles/ceph-rgw/tasks/multisite/destroy.yml
handlers: handlers:
- include: roles/ceph-rgw/handlers/main.yml
# Ansible 2.1.0 bug will ignore included handlers without this # Ansible 2.1.0 bug will ignore included handlers without this
static: True - name: import_tasks roles/ceph-rgw/handlers/main.yml
import_tasks: roles/ceph-rgw/handlers/main.yml

View File

@ -1,55 +1,39 @@
--- ---
- name: include installs/install_on_redhat.yml - name: include_tasks installs/install_on_redhat.yml
include: installs/install_on_redhat.yml include_tasks: installs/install_on_redhat.yml
when: when: ansible_os_family == 'RedHat'
- ansible_os_family == 'RedHat'
tags: tags:
- package-install - package-install
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include installs/install_on_suse.yml - name: include_tasks installs/install_on_suse.yml
include: installs/install_on_suse.yml include_tasks: installs/install_on_suse.yml
when: when: ansible_os_family == 'Suse'
- ansible_os_family == 'Suse'
tags: tags:
- package-install - package-install
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include installs/install_on_debian.yml - name: include_tasks installs/install_on_debian.yml
include: installs/install_on_debian.yml include_tasks: installs/install_on_debian.yml
when: when: ansible_os_family == 'Debian'
- ansible_os_family == 'Debian'
tags: tags:
- package-install - package-install
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include installs/install_on_clear.yml - name: include_tasks installs/install_on_clear.yml
include: installs/install_on_clear.yml include_tasks: installs/install_on_clear.yml
when: when: ansible_os_family == 'ClearLinux'
- ansible_os_family == 'ClearLinux'
tags: tags:
- package-install - package-install
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include ntp debian setup tasks - name: include_tasks "misc/ntp_debian.yml"
include: "misc/ntp_debian.yml" include_tasks: "misc/ntp_debian.yml"
when: when:
- ansible_os_family == 'Debian' - ansible_os_family == 'Debian'
- ntp_service_enabled - ntp_service_enabled
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include ntp rpm setup tasks - name: include_tasks "misc/ntp_rpm.yml"
include: "misc/ntp_rpm.yml" include_tasks: "misc/ntp_rpm.yml"
when: when:
- ansible_os_family in ['RedHat', 'Suse'] - ansible_os_family in ['RedHat', 'Suse']
- ntp_service_enabled - ntp_service_enabled
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: get ceph version - name: get ceph version
command: ceph --version command: ceph --version
@ -69,20 +53,16 @@
tags: tags:
- always - always
- name: include checks/check_firewall.yml - name: include_tasks checks/check_firewall.yml
include: checks/check_firewall.yml include_tasks: checks/check_firewall.yml
when: when:
- check_firewall - check_firewall
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include misc/configure_firewall_rpm.yml - name: include_tasks misc/configure_firewall_rpm.yml
include: misc/configure_firewall_rpm.yml include_tasks: misc/configure_firewall_rpm.yml
when: when:
- configure_firewall - configure_firewall
- ansible_os_family in ['RedHat', 'Suse'] - ansible_os_family in ['RedHat', 'Suse']
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include facts_mon_fsid.yml - name: include facts_mon_fsid.yml
include_tasks: facts_mon_fsid.yml include_tasks: facts_mon_fsid.yml

View File

@ -13,11 +13,9 @@
import_tasks: start_monitor.yml import_tasks: start_monitor.yml
when: not containerized_deployment when: not containerized_deployment
- name: include ceph_keys.yml - name: include_tasks ceph_keys.yml
include: ceph_keys.yml include_tasks: ceph_keys.yml
when: not containerized_deployment when: not containerized_deployment
# this avoids the bug mentioned here: https://github.com/ansible/ansible/issues/18206
static: no
- name: include secure_cluster.yml - name: include secure_cluster.yml
include_tasks: secure_cluster.yml include_tasks: secure_cluster.yml

View File

@ -1,8 +1,6 @@
--- ---
- name: include system_tuning.yml - name: include_tasks system_tuning.yml
include: system_tuning.yml include_tasks: system_tuning.yml
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: install dependencies - name: install dependencies
package: package:
@ -12,10 +10,8 @@
- not containerized_deployment - not containerized_deployment
- ansible_os_family != 'ClearLinux' - ansible_os_family != 'ClearLinux'
- name: include common.yml - name: include_tasks common.yml
include: common.yml include_tasks: common.yml
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include ceph_disk_cli_options_facts.yml - name: include ceph_disk_cli_options_facts.yml
include_tasks: ceph_disk_cli_options_facts.yml include_tasks: ceph_disk_cli_options_facts.yml
@ -35,61 +31,47 @@
when: when:
- osd_scenario != 'lvm' - osd_scenario != 'lvm'
- name: include scenarios/collocated.yml - name: include_tasks scenarios/collocated.yml
include: scenarios/collocated.yml include_tasks: scenarios/collocated.yml
when: when:
- osd_scenario == 'collocated' - osd_scenario == 'collocated'
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include scenarios/non-collocated.yml - name: include_tasks scenarios/non-collocated.yml
include: scenarios/non-collocated.yml include_tasks: scenarios/non-collocated.yml
when: when:
- not osd_auto_discovery - not osd_auto_discovery
- osd_scenario == 'non-collocated' - osd_scenario == 'non-collocated'
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include scenarios/lvm.yml - name: include_tasks scenarios/lvm.yml
include: scenarios/lvm.yml include_tasks: scenarios/lvm.yml
when: when:
- osd_scenario == 'lvm' - osd_scenario == 'lvm'
- lvm_volumes|length > 0 - lvm_volumes|length > 0
- not containerized_deployment - not containerized_deployment
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include scenarios/lvm-batch.yml - name: include_tasks scenarios/lvm-batch.yml
include: scenarios/lvm-batch.yml include_tasks: scenarios/lvm-batch.yml
when: when:
- osd_scenario == 'lvm' - osd_scenario == 'lvm'
- devices|length > 0 - devices|length > 0
- not containerized_deployment - not containerized_deployment
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include activate_osds.yml - name: include_tasks activate_osds.yml
include: activate_osds.yml include_tasks: activate_osds.yml
when: when:
- not containerized_deployment - not containerized_deployment
- osd_scenario != 'lvm' - osd_scenario != 'lvm'
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include start_osds.yml - name: include_tasks start_osds.yml
include: start_osds.yml include_tasks: start_osds.yml
when: when:
- not containerized_deployment - not containerized_deployment
- osd_scenario != 'lvm' - osd_scenario != 'lvm'
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include docker/main.yml - name: include_tasks docker/main.yml
include: docker/main.yml include_tasks: docker/main.yml
when: when:
- containerized_deployment - containerized_deployment
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: set_fact openstack_keys_tmp - preserve backward compatibility after the introduction of the ceph_keys module - name: set_fact openstack_keys_tmp - preserve backward compatibility after the introduction of the ceph_keys module
set_fact: set_fact:

View File

@ -2,42 +2,28 @@
- name: include common.yml - name: include common.yml
include_tasks: common.yml include_tasks: common.yml
- name: include pre_requisite.yml - name: include_tasks pre_requisite.yml
include: pre_requisite.yml include_tasks: pre_requisite.yml
when: when: not containerized_deployment
- not containerized_deployment
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include openstack-keystone.yml - name: include_tasks openstack-keystone.yml
include: openstack-keystone.yml include_tasks: openstack-keystone.yml
when: when: radosgw_keystone_ssl|bool
- radosgw_keystone_ssl|bool
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include start_radosgw.yml - name: include_tasks start_radosgw.yml
include: start_radosgw.yml include_tasks: start_radosgw.yml
when: when: not containerized_deployment
- not containerized_deployment
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include multisite/main.yml - name: include_tasks multisite/main.yml
include: multisite/main.yml include_tasks: multisite/main.yml
when: when:
- rgw_zone != "" - rgw_zone != ""
- rgw_multisite - rgw_multisite
- ceph_release_num[ceph_release] >= ceph_release_num.jewel - ceph_release_num[ceph_release] >= ceph_release_num.jewel
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include docker/main.yml - name: include_tasks docker/main.yml
include: docker/main.yml include_tasks: docker/main.yml
when: when: containerized_deployment
- containerized_deployment
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: create rgw pools if rgw_create_pools is defined - name: create rgw pools if rgw_create_pools is defined
command: "{{ docker_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool create {{ item.key }} {{ item.value.pg_num }}" command: "{{ docker_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool create {{ item.key }} {{ item.value.pg_num }}"

View File

@ -3,21 +3,17 @@
include_tasks: checks.yml include_tasks: checks.yml
# Include the tasks depending on the zone type # Include the tasks depending on the zone type
- name: include master multisite tasks - name: include_tasks master.yml
include: master.yml include_tasks: master.yml
when: when:
- rgw_zonemaster is defined - rgw_zonemaster is defined
- rgw_zonemaster - rgw_zonemaster
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include secondary multisite tasks - name: include_tasks secondary.yml
include: secondary.yml include_tasks: secondary.yml
when: when:
- rgw_zonesecondary is defined - rgw_zonesecondary is defined
- rgw_zonesecondary - rgw_zonesecondary
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
# Continue with common tasks # Continue with common tasks
- name: add zone to rgw stanza in ceph.conf - name: add zone to rgw stanza in ceph.conf