diff --git a/contrib/splitup.yml b/contrib/splitup.yml index 9c3d804d3..c3bc28001 100644 --- a/contrib/splitup.yml +++ b/contrib/splitup.yml @@ -45,14 +45,14 @@ command: git subtree split --prefix=roles/{{ item }} -b {{ item }} --squash args: chdir: "{{ basedir }}" - with_items: roles + with_items: "{{ roles }}" - name: adds remote github repos for the splits tags: split command: git remote add {{ item }} git@github.com:{{ github }}-{{ item }}.git args: chdir: "{{ basedir }}" - with_items: roles + with_items: "{{ roles }}" - name: adds upstream remote tags: update @@ -68,4 +68,4 @@ shell: git push {{ item }} $(git subtree split --prefix roles/{{ item }} master):master --force args: chdir: "{{ basedir }}" - with_items: roles + with_items: "{{ roles }}" diff --git a/group_vars/mdss.sample b/group_vars/mdss.sample index 308ac192e..303989cde 100644 --- a/group_vars/mdss.sample +++ b/group_vars/mdss.sample @@ -37,4 +37,5 @@ dummy: #ceph_mds_docker_image_tag: latest #ceph_mds_docker_extra_env: "MDS_NAME={{ ansible_hostname }}" # comma separated variables #ceph_docker_on_openstack: false +#ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/mons.sample b/group_vars/mons.sample index e4ea4d434..5bd1cde79 100644 --- a/group_vars/mons.sample +++ b/group_vars/mons.sample @@ -89,4 +89,5 @@ dummy: #ceph_docker_on_openstack: false #mon_docker_privileged: false #mon_docker_net_host: true +#ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/nfss.sample b/group_vars/nfss.sample index e0942cb92..7bd6ba095 100644 --- a/group_vars/nfss.sample +++ b/group_vars/nfss.sample @@ -19,6 +19,7 @@ dummy: # #cephx: true + ####################### # Access type options # ####################### @@ -89,4 +90,5 @@ dummy: #ceph_nfs_docker_image_tag: latest #ceph_nfs_docker_extra_env: "GANESHA_EPOCH={{ ganesha_epoch }}" # comma separated variables #ceph_docker_on_openstack: false +#ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/osds.sample b/group_vars/osds.sample index 88d1b6b62..b1eb4f91c 100644 --- a/group_vars/osds.sample +++ b/group_vars/osds.sample @@ -183,4 +183,5 @@ dummy: #ceph_osd_docker_devices: # - /dev/sdb #ceph_docker_on_openstack: false +#ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/rbd-mirrors.sample b/group_vars/rbd-mirrors.sample index a32435e79..15ab9cd02 100644 --- a/group_vars/rbd-mirrors.sample +++ b/group_vars/rbd-mirrors.sample @@ -11,6 +11,7 @@ dummy: # SETUP # ######### + # NOTE (leseb): the rbd-mirror daemon needs a user to start # because it has to authenticate with the local cluster. # By default, using the admin user is fine, so you should not @@ -49,4 +50,5 @@ dummy: #ceph_rbd_mirror_docker_imagename: daemon #ceph_rbd_mirror_docker_image_tag: latest #ceph_docker_on_openstack: false +#ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/restapis.sample b/group_vars/restapis.sample index f21cbcef7..a4e01e753 100644 --- a/group_vars/restapis.sample +++ b/group_vars/restapis.sample @@ -26,4 +26,5 @@ dummy: #ceph_restapi_docker_image_tag: latest #ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables #ceph_docker_on_openstack: false +#ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/rgws.sample b/group_vars/rgws.sample index 3916c9ab7..05d5fd851 100644 --- a/group_vars/rgws.sample +++ b/group_vars/rgws.sample @@ -44,4 +44,5 @@ dummy: #ceph_rgw_docker_image_tag: latest #ceph_rgw_docker_extra_env: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables #ceph_docker_on_openstack: false +#ceph_config_keys: [] # DON'T TOUCH ME diff --git a/infrastructure-playbooks/cluster-os-migration.yml b/infrastructure-playbooks/cluster-os-migration.yml index 21e17d904..7126c862d 100644 --- a/infrastructure-playbooks/cluster-os-migration.yml +++ b/infrastructure-playbooks/cluster-os-migration.yml @@ -119,7 +119,7 @@ group=root mode=0644 delegate_to: "{{ item }}" - with_items: groups.backup[0] + with_items: "{{ groups.backup[0] }}" when: migration_completed.stat.exists == False # NOTE (leseb): should we convert upstart to sysvinit here already? @@ -224,7 +224,7 @@ retries: 5 delay: 10 delegate_to: "{{ item }}" - with_items: groups.backup[0] + with_items: "{{ groups.backup[0] }}" when: migration_completed.stat.exists == False - name: Done moving to the next monitor @@ -280,7 +280,7 @@ - name: Set the noout flag command: ceph osd set noout delegate_to: "{{ item }}" - with_items: groups.mons[0] + with_items: "{{ groups.mons[0] }}" when: migration_completed.stat.exists == False - name: Check if sysvinit @@ -310,7 +310,7 @@ group=root mode=0644 delegate_to: "{{ item }}" - with_items: groups.backup[0] + with_items: "{{ groups.backup[0] }}" when: migration_completed.stat.exists == False - name: Scp OSDs dirs and configs @@ -345,8 +345,7 @@ port={{ item }} timeout=10 state=stopped - with_items: - - "{{ osd_ports.stdout_lines }}" + with_items: "{{ osd_ports.stdout_lines }}" when: migration_completed.stat.exists == False - name: Configure RHEL with sysvinit @@ -413,7 +412,7 @@ retries: 10 delay: 10 delegate_to: "{{ item }}" - with_items: groups.backup[0] + with_items: "{{ groups.backup[0] }}" when: migration_completed.stat.exists == False - name: Done moving to the next OSD @@ -428,7 +427,7 @@ - name: Unset the noout flag command: ceph osd unset noout delegate_to: "{{ item }}" - with_items: groups.mons[0] + with_items: "{{ groups.mons[0] }}" when: migration_completed.stat.exists == False - hosts: rgws @@ -468,7 +467,7 @@ group=root mode=0644 delegate_to: "{{ item }}" - with_items: groups.backup[0] + with_items: "{{ groups.backup[0] }}" when: migration_completed.stat.exists == False - name: Scp RGWs dirs and configs diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index fd055a2a5..07245423d 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -420,7 +420,7 @@ raw_device=$(echo "{{ item }}" | egrep -o '/dev/([hsv]d[a-z]{1,2}|cciss/c[0-9]d[0-9]p|nvme[0-9]n[0-9]p){1,2}') partition_nb=$(echo "{{ item }}" | egrep -o '[0-9]{1,2}$') sgdisk --delete $partition_nb $raw_device - with_items: "{{ceph_journal_partition_to_erase_path.stdout_lines}}" + with_items: "{{ ceph_journal_partition_to_erase_path.stdout_lines }}" when: ceph_journal_partlabels.rc == 0 and zap_block_devs diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 461a1da4c..df7a407fe 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -143,7 +143,7 @@ - name: select a running monitor set_fact: mon_host={{ item }} - with_items: groups.mons + with_items: "{{ groups.mons }}" when: item != inventory_hostname - name: waiting for the monitor to join the quorum... diff --git a/infrastructure-playbooks/shrink-osd.yml b/infrastructure-playbooks/shrink-osd.yml index 5fb1bd60f..bf266b6fa 100644 --- a/infrastructure-playbooks/shrink-osd.yml +++ b/infrastructure-playbooks/shrink-osd.yml @@ -70,7 +70,7 @@ - fail: msg: "Ceph's configuration file is not present in /etc/ceph" - with_items: "{{ceph_conf_key.results}}" + with_items: "{{ ceph_conf_key.results }}" when: - item.stat.exists == false @@ -91,11 +91,11 @@ # - name: find the host where the osd(s) is/are running on command: ceph --cluster {{ cluster }} osd find {{ item }} - with_items: "{{osd_ids.split(',')}}" + with_items: "{{ osd_ids.split(',') }}" register: osd_hosts - set_fact: ip_item="{{(item.stdout | from_json).ip}}" - with_items: "{{osd_hosts.results}}" + with_items: "{{ osd_hosts.results }}" register: ip_result - set_fact: ips="{{ ip_result.results | map(attribute='ansible_facts.ip_item') | list }}" @@ -106,26 +106,26 @@ stat: path: "/etc/ceph/{{ cluster }}.client.admin.keyring" register: ceph_admin_key - with_items: "{{real_ips}}" - delegate_to: "{{item}}" + with_items: "{{ real_ips }}" + delegate_to: "{{ item }}" failed_when: false - fail: msg: "The Ceph admin key is not present on the OSD node, please add it and remove it after the playbook is done." - with_items: "{{ceph_admin_key.results}}" + with_items: "{{ ceph_admin_key.results }}" when: - item.stat.exists == false - name: deactivating osd(s) command: ceph-disk deactivate --cluster {{ cluster }} --deactivate-by-id {{ item.0 }} --mark-out with_together: - - "{{osd_ids.split(',')}}" - - "{{real_ips}}" - delegate_to: "{{item.1}}" + - "{{ osd_ids.split(',') }}" + - "{{ real_ips }}" + delegate_to: "{{ item.1 }}" - name: destroying osd(s) command: ceph-disk destroy --cluster {{ cluster }} --destroy-by-id {{ item.0 }} --zap with_together: - - "{{osd_ids.split(',')}}" - - "{{real_ips}}" - delegate_to: "{{item.1}}" + - "{{ osd_ids.split(',') }}" + - "{{ real_ips }}" + delegate_to: "{{ item.1 }}" diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index e8fcbf8d6..6fdf6b776 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -93,7 +93,7 @@ - name: switching from non-containerized to containerized ceph mon vars: - mon_group_name: mons + mon_group_name: mons restapi_group_name: restapis hosts: @@ -115,7 +115,7 @@ - name: select a running monitor set_fact: mon_host={{ item }} - with_items: groups.mons + with_items: "{{ groups.mons }}" when: item != inventory_hostname - name: get current ceph fsid diff --git a/plugins/actions/_v1_config_template.py b/plugins/actions/_v1_config_template.py index f080d1d99..579c7f89b 100644 --- a/plugins/actions/_v1_config_template.py +++ b/plugins/actions/_v1_config_template.py @@ -267,7 +267,7 @@ class ActionModule(object): else: config.set(str(section), str(key), str(value)) - def return_config_overrides_ini(self, config_overrides, resultant): + def return_config_overrides_ini(self, config_overrides, resultant, list_extend=True): """Returns string value from a modified config file. :param config_overrides: ``dict`` @@ -278,6 +278,7 @@ class ActionModule(object): dict_type=MultiKeyDict, allow_no_value=True ) + config.optionxform = str config_object = io.BytesIO(resultant.encode('utf-8')) config.readfp(config_object) for section, items in config_overrides.items(): @@ -307,7 +308,7 @@ class ActionModule(object): finally: resultant_bytesio.close() - def return_config_overrides_json(self, config_overrides, resultant): + def return_config_overrides_json(self, config_overrides, resultant, list_extend=True): """Returns config json Its important to note that file ordering will not be preserved as the @@ -320,7 +321,8 @@ class ActionModule(object): original_resultant = json.loads(resultant) merged_resultant = self._merge_dict( base_items=original_resultant, - new_items=config_overrides + new_items=config_overrides, + list_extend=list_extend ) return json.dumps( merged_resultant, @@ -328,7 +330,7 @@ class ActionModule(object): sort_keys=True ) - def return_config_overrides_yaml(self, config_overrides, resultant): + def return_config_overrides_yaml(self, config_overrides, resultant, list_extend=True): """Return config yaml. :param config_overrides: ``dict`` @@ -338,7 +340,8 @@ class ActionModule(object): original_resultant = yaml.safe_load(resultant) merged_resultant = self._merge_dict( base_items=original_resultant, - new_items=config_overrides + new_items=config_overrides, + list_extend=list_extend ) return yaml.safe_dump( merged_resultant, @@ -346,7 +349,7 @@ class ActionModule(object): width=1000, ) - def _merge_dict(self, base_items, new_items): + def _merge_dict(self, base_items, new_items, list_extend=True): """Recursively merge new_items into base_items. :param base_items: ``dict`` @@ -363,7 +366,10 @@ class ActionModule(object): base_items[key] = re.split(', |,|\n', value) base_items[key] = [i.strip() for i in base_items[key] if i] elif isinstance(value, list): - base_items[key] = value + if isinstance(base_items.get(key), list) and list_extend: + base_items[key].extend(value) + else: + base_items[key] = value else: base_items[key] = new_items[key] return base_items @@ -417,7 +423,8 @@ class ActionModule(object): type_merger = getattr(self, CONFIG_TYPES.get(config_type)) resultant = type_merger( config_overrides=config_overrides, - resultant=resultant + resultant=resultant, + list_extend=options.get('list_extend', True) ) # Retemplate the resultant object as it may have new data within it @@ -445,6 +452,7 @@ class ActionModule(object): # Remove data types that are not available to the copy module complex_args.pop('config_overrides') complex_args.pop('config_type') + complex_args.pop('list_extend', None) # Return the copy module status. Access to protected method is # unavoidable in Ansible 1.x. diff --git a/plugins/actions/_v2_config_template.py b/plugins/actions/_v2_config_template.py index 9cac8f996..a9bc2f580 100644 --- a/plugins/actions/_v2_config_template.py +++ b/plugins/actions/_v2_config_template.py @@ -465,7 +465,12 @@ class ActionModule(ActionBase): """Run the method""" try: - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = task_vars.get('ansible_user') + if not remote_user: + remote_user = task_vars.get('ansible_ssh_user') + if not remote_user: + remote_user = self._play_context.remote_user + if not tmp: tmp = self._make_tmp_path(remote_user) except TypeError: diff --git a/roles/ceph-client/tasks/create_users_keys.yml b/roles/ceph-client/tasks/create_users_keys.yml index f52864dc8..0cc5af74a 100644 --- a/roles/ceph-client/tasks/create_users_keys.yml +++ b/roles/ceph-client/tasks/create_users_keys.yml @@ -1,7 +1,7 @@ --- - name: create pools command: ceph --cluster {{ cluster }} osd pool create {{ item.name }} {{ item.pgs }} - with_items: pools + with_items: "{{ pools }}" changed_when: false failed_when: false @@ -9,6 +9,6 @@ command: ceph --cluster {{ cluster }} auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/{{ cluster }}.{{ item.name }}.keyring args: creates: /etc/ceph/{{ cluster }}.{{ item.name }}.keyring - with_items: keys + with_items: "{{ keys }}" changed_when: false when: cephx diff --git a/roles/ceph-common/plugins/actions/_v1_config_template.py b/roles/ceph-common/plugins/actions/_v1_config_template.py index f080d1d99..579c7f89b 100644 --- a/roles/ceph-common/plugins/actions/_v1_config_template.py +++ b/roles/ceph-common/plugins/actions/_v1_config_template.py @@ -267,7 +267,7 @@ class ActionModule(object): else: config.set(str(section), str(key), str(value)) - def return_config_overrides_ini(self, config_overrides, resultant): + def return_config_overrides_ini(self, config_overrides, resultant, list_extend=True): """Returns string value from a modified config file. :param config_overrides: ``dict`` @@ -278,6 +278,7 @@ class ActionModule(object): dict_type=MultiKeyDict, allow_no_value=True ) + config.optionxform = str config_object = io.BytesIO(resultant.encode('utf-8')) config.readfp(config_object) for section, items in config_overrides.items(): @@ -307,7 +308,7 @@ class ActionModule(object): finally: resultant_bytesio.close() - def return_config_overrides_json(self, config_overrides, resultant): + def return_config_overrides_json(self, config_overrides, resultant, list_extend=True): """Returns config json Its important to note that file ordering will not be preserved as the @@ -320,7 +321,8 @@ class ActionModule(object): original_resultant = json.loads(resultant) merged_resultant = self._merge_dict( base_items=original_resultant, - new_items=config_overrides + new_items=config_overrides, + list_extend=list_extend ) return json.dumps( merged_resultant, @@ -328,7 +330,7 @@ class ActionModule(object): sort_keys=True ) - def return_config_overrides_yaml(self, config_overrides, resultant): + def return_config_overrides_yaml(self, config_overrides, resultant, list_extend=True): """Return config yaml. :param config_overrides: ``dict`` @@ -338,7 +340,8 @@ class ActionModule(object): original_resultant = yaml.safe_load(resultant) merged_resultant = self._merge_dict( base_items=original_resultant, - new_items=config_overrides + new_items=config_overrides, + list_extend=list_extend ) return yaml.safe_dump( merged_resultant, @@ -346,7 +349,7 @@ class ActionModule(object): width=1000, ) - def _merge_dict(self, base_items, new_items): + def _merge_dict(self, base_items, new_items, list_extend=True): """Recursively merge new_items into base_items. :param base_items: ``dict`` @@ -363,7 +366,10 @@ class ActionModule(object): base_items[key] = re.split(', |,|\n', value) base_items[key] = [i.strip() for i in base_items[key] if i] elif isinstance(value, list): - base_items[key] = value + if isinstance(base_items.get(key), list) and list_extend: + base_items[key].extend(value) + else: + base_items[key] = value else: base_items[key] = new_items[key] return base_items @@ -417,7 +423,8 @@ class ActionModule(object): type_merger = getattr(self, CONFIG_TYPES.get(config_type)) resultant = type_merger( config_overrides=config_overrides, - resultant=resultant + resultant=resultant, + list_extend=options.get('list_extend', True) ) # Retemplate the resultant object as it may have new data within it @@ -445,6 +452,7 @@ class ActionModule(object): # Remove data types that are not available to the copy module complex_args.pop('config_overrides') complex_args.pop('config_type') + complex_args.pop('list_extend', None) # Return the copy module status. Access to protected method is # unavoidable in Ansible 1.x. diff --git a/roles/ceph-common/plugins/actions/_v2_config_template.py b/roles/ceph-common/plugins/actions/_v2_config_template.py index 6870f9662..a9bc2f580 100644 --- a/roles/ceph-common/plugins/actions/_v2_config_template.py +++ b/roles/ceph-common/plugins/actions/_v2_config_template.py @@ -262,7 +262,7 @@ class ConfigTemplateParser(ConfigParser.RawConfigParser): class ActionModule(ActionBase): TRANSFERS_FILES = True - def return_config_overrides_ini(self, config_overrides, resultant): + def return_config_overrides_ini(self, config_overrides, resultant, list_extend=True): """Returns string value from a modified config file. :param config_overrides: ``dict`` @@ -338,7 +338,7 @@ class ActionModule(ActionBase): else: config.set(str(section), str(key), str(value)) - def return_config_overrides_json(self, config_overrides, resultant): + def return_config_overrides_json(self, config_overrides, resultant, list_extend=True): """Returns config json Its important to note that file ordering will not be preserved as the @@ -351,7 +351,8 @@ class ActionModule(ActionBase): original_resultant = json.loads(resultant) merged_resultant = self._merge_dict( base_items=original_resultant, - new_items=config_overrides + new_items=config_overrides, + list_extend=list_extend ) return json.dumps( merged_resultant, @@ -359,7 +360,7 @@ class ActionModule(ActionBase): sort_keys=True ) - def return_config_overrides_yaml(self, config_overrides, resultant): + def return_config_overrides_yaml(self, config_overrides, resultant, list_extend=True): """Return config yaml. :param config_overrides: ``dict`` @@ -369,7 +370,8 @@ class ActionModule(ActionBase): original_resultant = yaml.safe_load(resultant) merged_resultant = self._merge_dict( base_items=original_resultant, - new_items=config_overrides + new_items=config_overrides, + list_extend=list_extend ) return yaml.safe_dump( merged_resultant, @@ -377,7 +379,7 @@ class ActionModule(ActionBase): width=1000, ) - def _merge_dict(self, base_items, new_items): + def _merge_dict(self, base_items, new_items, list_extend=True): """Recursively merge new_items into base_items. :param base_items: ``dict`` @@ -387,14 +389,15 @@ class ActionModule(ActionBase): for key, value in new_items.iteritems(): if isinstance(value, dict): base_items[key] = self._merge_dict( - base_items.get(key, {}), - value + base_items=base_items.get(key, {}), + new_items=value, + list_extend=list_extend ) elif not isinstance(value, int) and (',' in value or '\n' in value): base_items[key] = re.split(',|\n', value) base_items[key] = [i.strip() for i in base_items[key] if i] elif isinstance(value, list): - if key in base_items and isinstance(base_items[key], list): + if isinstance(base_items.get(key), list) and list_extend: base_items[key].extend(value) else: base_items[key] = value @@ -416,38 +419,28 @@ class ActionModule(ActionBase): # Access to protected method is unavoidable in Ansible searchpath = [self._loader._basedir] - faf = self._task.first_available_file - if faf: - task_file = task_vars.get('_original_file', None, 'templates') - source = self._get_first_available_file(faf, task_file) - if not source: - return False, dict( - failed=True, - msg="could not find src in first_available_file list" - ) + if self._task._role: + file_path = self._task._role._role_path + searchpath.insert(1, C.DEFAULT_ROLES_PATH) + searchpath.insert(1, self._task._role._role_path) else: - # Access to protected method is unavoidable in Ansible - if self._task._role: - file_path = self._task._role._role_path - searchpath.insert(1, C.DEFAULT_ROLES_PATH) - searchpath.insert(1, self._task._role._role_path) - else: - file_path = self._loader.get_basedir() + file_path = self._loader.get_basedir() - user_source = self._task.args.get('src') - if not user_source: - return False, dict( - failed=True, - msg="No user provided [ src ] was provided" - ) - source = self._loader.path_dwim_relative( - file_path, - 'templates', - user_source + user_source = self._task.args.get('src') + if not user_source: + return False, dict( + failed=True, + msg="No user provided [ src ] was provided" ) - searchpath.insert(1, os.path.dirname(source)) + source = self._loader.path_dwim_relative( + file_path, + 'templates', + user_source + ) + searchpath.insert(1, os.path.dirname(source)) _dest = self._task.args.get('dest') + list_extend = self._task.args.get('list_extend') if not _dest: return False, dict( failed=True, @@ -464,14 +457,20 @@ class ActionModule(ActionBase): dest=user_dest, config_overrides=self._task.args.get('config_overrides', dict()), config_type=config_type, - searchpath=searchpath + searchpath=searchpath, + list_extend=list_extend ) def run(self, tmp=None, task_vars=None): """Run the method""" try: - remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user + remote_user = task_vars.get('ansible_user') + if not remote_user: + remote_user = task_vars.get('ansible_ssh_user') + if not remote_user: + remote_user = self._play_context.remote_user + if not tmp: tmp = self._make_tmp_path(remote_user) except TypeError: @@ -531,7 +530,8 @@ class ActionModule(ActionBase): type_merger = getattr(self, CONFIG_TYPES.get(_vars['config_type'])) resultant = type_merger( config_overrides=_vars['config_overrides'], - resultant=resultant + resultant=resultant, + list_extend=_vars.get('list_extend', True) ) # Re-template the resultant object as it may have new data within it @@ -562,6 +562,7 @@ class ActionModule(ActionBase): # Remove data types that are not available to the copy module new_module_args.pop('config_overrides', None) new_module_args.pop('config_type', None) + new_module_args.pop('list_extend', None) # Run the copy module return self._execute_module( diff --git a/roles/ceph-common/tasks/facts.yml b/roles/ceph-common/tasks/facts.yml index 4491f6874..dd6129517 100644 --- a/roles/ceph-common/tasks/facts.yml +++ b/roles/ceph-common/tasks/facts.yml @@ -2,7 +2,7 @@ - name: get ceph version command: ceph --version changed_when: false - always_run: true + check_mode: no register: ceph_version - set_fact: @@ -12,7 +12,7 @@ - name: check init system slurp: src: /proc/1/comm - always_run: true + check_mode: no register: init_system - set_fact: diff --git a/roles/ceph-common/tasks/installs/install_on_debian.yml b/roles/ceph-common/tasks/installs/install_on_debian.yml index 1f0ceeda3..9a464988b 100644 --- a/roles/ceph-common/tasks/installs/install_on_debian.yml +++ b/roles/ceph-common/tasks/installs/install_on_debian.yml @@ -5,7 +5,7 @@ state: present update_cache: yes cache_valid_time: 3600 - with_items: "{{debian_package_dependencies}}" + with_items: "{{ debian_package_dependencies }}" - name: configure ceph apt repository include: debian_ceph_repository.yml @@ -17,7 +17,7 @@ update_cache: yes state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" default_release: "{{ ceph_stable_release_uca | default(ansible_distribution_release) }}{{ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}}" - with_items: "{{debian_ceph_packages}}" + with_items: "{{ debian_ceph_packages }}" - name: install ceph-test apt: diff --git a/roles/ceph-common/tasks/installs/install_rh_storage_on_debian.yml b/roles/ceph-common/tasks/installs/install_rh_storage_on_debian.yml index 1a67ef6ce..8feabcb87 100644 --- a/roles/ceph-common/tasks/installs/install_rh_storage_on_debian.yml +++ b/roles/ceph-common/tasks/installs/install_rh_storage_on_debian.yml @@ -37,7 +37,7 @@ state: present update_cache: yes cache_valid_time: 3600 - with_items: debian_package_dependencies + with_items: "{{ debian_package_dependencies }}" - name: install red hat storage ceph mon apt: diff --git a/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml b/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml index b950e1136..97f392322 100644 --- a/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml @@ -20,7 +20,7 @@ yum: name: "{{ item }}" state: present - with_items: redhat_package_dependencies + with_items: "{{ redhat_package_dependencies }}" when: - ansible_pkg_mgr == "yum" diff --git a/roles/ceph-common/tasks/misc/system_tuning.yml b/roles/ceph-common/tasks/misc/system_tuning.yml index 621770520..5b38a63b3 100644 --- a/roles/ceph-common/tasks/misc/system_tuning.yml +++ b/roles/ceph-common/tasks/misc/system_tuning.yml @@ -14,7 +14,7 @@ command: sysctl -b vm.min_free_kbytes changed_when: false failed_when: false - always_run: true + check_mode: no register: default_vm_min_free_kbytes - name: define vm.min_free_kbytes @@ -28,4 +28,4 @@ state: present sysctl_file: /etc/sysctl.conf ignoreerrors: yes - with_items: os_tuning_params + with_items: "{{ os_tuning_params }}" diff --git a/roles/ceph-mds/defaults/main.yml b/roles/ceph-mds/defaults/main.yml index c20bc7c4f..e59e7208f 100644 --- a/roles/ceph-mds/defaults/main.yml +++ b/roles/ceph-mds/defaults/main.yml @@ -29,3 +29,4 @@ ceph_mds_docker_imagename: daemon ceph_mds_docker_image_tag: latest ceph_mds_docker_extra_env: "MDS_NAME={{ ansible_hostname }}" # comma separated variables ceph_docker_on_openstack: false +ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-mds/tasks/docker/checks.yml b/roles/ceph-mds/tasks/docker/checks.yml index 53ea48053..09cb57b57 100644 --- a/roles/ceph-mds/tasks/docker/checks.yml +++ b/roles/ceph-mds/tasks/docker/checks.yml @@ -13,7 +13,7 @@ - name: stat for ceph config and keys stat: path: "{{ item }}" - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false failed_when: false register: statleftover @@ -22,6 +22,6 @@ fail: msg: "looks like no cluster is running but ceph files are present, please remove them" with_together: - - ceph_config_keys - - statleftover.results + - "{{ ceph_config_keys }}" + - "{{ statleftover.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-mds/tasks/docker/fetch_configs.yml b/roles/ceph-mds/tasks/docker/fetch_configs.yml index 7153506f7..59fbf9f8b 100644 --- a/roles/ceph-mds/tasks/docker/fetch_configs.yml +++ b/roles/ceph-mds/tasks/docker/fetch_configs.yml @@ -10,7 +10,7 @@ - name: stat for ceph config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false become: false failed_when: false @@ -25,6 +25,6 @@ mode: 0644 changed_when: false with_together: - - ceph_config_keys - - statconfig.results + - "{{ ceph_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-mon/defaults/main.yml b/roles/ceph-mon/defaults/main.yml index 0737ef3ea..77ae55cec 100644 --- a/roles/ceph-mon/defaults/main.yml +++ b/roles/ceph-mon/defaults/main.yml @@ -81,3 +81,4 @@ ceph_mon_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variabl ceph_docker_on_openstack: false mon_docker_privileged: false mon_docker_net_host: true +ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-mon/tasks/docker/checks.yml b/roles/ceph-mon/tasks/docker/checks.yml index 53ea48053..09cb57b57 100644 --- a/roles/ceph-mon/tasks/docker/checks.yml +++ b/roles/ceph-mon/tasks/docker/checks.yml @@ -13,7 +13,7 @@ - name: stat for ceph config and keys stat: path: "{{ item }}" - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false failed_when: false register: statleftover @@ -22,6 +22,6 @@ fail: msg: "looks like no cluster is running but ceph files are present, please remove them" with_together: - - ceph_config_keys - - statleftover.results + - "{{ ceph_config_keys }}" + - "{{ statleftover.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-mon/tasks/docker/copy_configs.yml b/roles/ceph-mon/tasks/docker/copy_configs.yml index f2ba50e81..e5a684a96 100644 --- a/roles/ceph-mon/tasks/docker/copy_configs.yml +++ b/roles/ceph-mon/tasks/docker/copy_configs.yml @@ -5,6 +5,6 @@ dest: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}" flat: yes with_together: - - ceph_config_keys - - statconfig.results + - "{{ ceph_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == false diff --git a/roles/ceph-mon/tasks/docker/fetch_configs.yml b/roles/ceph-mon/tasks/docker/fetch_configs.yml index 63c8b3c45..00ed642ab 100644 --- a/roles/ceph-mon/tasks/docker/fetch_configs.yml +++ b/roles/ceph-mon/tasks/docker/fetch_configs.yml @@ -12,7 +12,7 @@ - name: stat for ceph config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false become: false failed_when: false @@ -27,6 +27,6 @@ mode: 0644 changed_when: false with_together: - - ceph_config_keys - - statconfig.results + - "{{ ceph_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-mon/tasks/secure_cluster.yml b/roles/ceph-mon/tasks/secure_cluster.yml index 74666493a..a388cca44 100644 --- a/roles/ceph-mon/tasks/secure_cluster.yml +++ b/roles/ceph-mon/tasks/secure_cluster.yml @@ -8,5 +8,5 @@ command: ceph --cluster {{ cluster }} osd pool set {{ item[0] }} {{ item[1] }} true with_nested: - "{{ ceph_pools.stdout_lines|default([]) }}" - - secure_cluster_flags + - "{{ secure_cluster_flags }}" when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.hammer diff --git a/roles/ceph-nfs/defaults/main.yml b/roles/ceph-nfs/defaults/main.yml index f4b82f316..adab1743e 100644 --- a/roles/ceph-nfs/defaults/main.yml +++ b/roles/ceph-nfs/defaults/main.yml @@ -11,6 +11,7 @@ fetch_directory: fetch/ # cephx: true + ####################### # Access type options # ####################### @@ -81,3 +82,4 @@ ceph_nfs_docker_imagename: ganesha ceph_nfs_docker_image_tag: latest #ceph_nfs_docker_extra_env: "GANESHA_EPOCH={{ ganesha_epoch }}" # comma separated variables ceph_docker_on_openstack: false +ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-nfs/tasks/docker/checks.yml b/roles/ceph-nfs/tasks/docker/checks.yml index 992fc0e33..ec58106f6 100644 --- a/roles/ceph-nfs/tasks/docker/checks.yml +++ b/roles/ceph-nfs/tasks/docker/checks.yml @@ -11,7 +11,7 @@ - name: stat for ceph config and keys stat: path: "{{ item }}" - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false failed_when: false register: statleftover @@ -20,6 +20,6 @@ fail: msg: "looks like no cluster is running but ceph files are present, please remove them" with_together: - - ceph_config_keys - - statleftover.results + - "{{ ceph_config_keys }}" + - "{{ statleftover.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-nfs/tasks/docker/copy_configs.yml b/roles/ceph-nfs/tasks/docker/copy_configs.yml index 6b37760b3..920c7623d 100644 --- a/roles/ceph-nfs/tasks/docker/copy_configs.yml +++ b/roles/ceph-nfs/tasks/docker/copy_configs.yml @@ -8,7 +8,7 @@ - name: stat for config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false become: false failed_when: false @@ -23,6 +23,6 @@ mode: 0644 changed_when: false with_together: - - ceph_config_keys - - statconfig.results + - "{{ ceph_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-nfs/tasks/docker/fetch_configs.yml b/roles/ceph-nfs/tasks/docker/fetch_configs.yml index 07e6a40d2..d94b1dad6 100644 --- a/roles/ceph-nfs/tasks/docker/fetch_configs.yml +++ b/roles/ceph-nfs/tasks/docker/fetch_configs.yml @@ -6,7 +6,7 @@ - name: stat for config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: nfs_config_keys + with_items: "{{ nfs_config_keys }}" changed_when: false become: false failed_when: false @@ -21,8 +21,8 @@ mode: 0644 changed_when: false with_together: - - nfs_config_keys - - statconfig.results + - "{{ nfs_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == true - name: push ganesha files to the ansible server @@ -31,6 +31,6 @@ dest: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}" flat: yes with_together: - - nfs_config_keys - - statconfig.results + - "{{ nfs_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == false diff --git a/roles/ceph-osd/defaults/main.yml b/roles/ceph-osd/defaults/main.yml index a4757f9e8..4a1710c25 100644 --- a/roles/ceph-osd/defaults/main.yml +++ b/roles/ceph-osd/defaults/main.yml @@ -175,3 +175,4 @@ ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE" # comma separate #ceph_osd_docker_devices: # - /dev/sdb ceph_docker_on_openstack: false +ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index 834ac3eac..1ea1d5e9d 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -5,7 +5,7 @@ - name: automatically activate osd disk(s) without partitions command: ceph-disk activate "/dev/{{ item.key | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1" ignore_errors: true - with_dict: ansible_devices + with_dict: "{{ ansible_devices }}" when: - ansible_devices is defined - item.value.removable == "0" @@ -30,7 +30,7 @@ - name: automatically activate osd disk(s) without partitions (dmcrypt) command: ceph-disk activate --dmcrypt "/dev/{{ item.key }}" ignore_errors: true - with_dict: ansible_devices + with_dict: "{{ ansible_devices }}" when: - ansible_devices is defined - item.value.removable == "0" diff --git a/roles/ceph-osd/tasks/check_devices_auto.yml b/roles/ceph-osd/tasks/check_devices_auto.yml index 27c9abc0c..29985bed1 100644 --- a/roles/ceph-osd/tasks/check_devices_auto.yml +++ b/roles/ceph-osd/tasks/check_devices_auto.yml @@ -11,7 +11,7 @@ - name: check the partition status of the osd disks (autodiscover disks) shell: "parted --script /dev/{{ item.key }} print > /dev/null 2>&1" - with_dict: '{{ ansible_devices }}' + with_dict: "{{ ansible_devices }}" changed_when: false failed_when: false register: osd_partition_status_results diff --git a/roles/ceph-osd/tasks/docker/checks.yml b/roles/ceph-osd/tasks/docker/checks.yml index 53ea48053..09cb57b57 100644 --- a/roles/ceph-osd/tasks/docker/checks.yml +++ b/roles/ceph-osd/tasks/docker/checks.yml @@ -13,7 +13,7 @@ - name: stat for ceph config and keys stat: path: "{{ item }}" - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false failed_when: false register: statleftover @@ -22,6 +22,6 @@ fail: msg: "looks like no cluster is running but ceph files are present, please remove them" with_together: - - ceph_config_keys - - statleftover.results + - "{{ ceph_config_keys }}" + - "{{ statleftover.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-osd/tasks/docker/fetch_configs.yml b/roles/ceph-osd/tasks/docker/fetch_configs.yml index 540dad17f..0e1f0658a 100644 --- a/roles/ceph-osd/tasks/docker/fetch_configs.yml +++ b/roles/ceph-osd/tasks/docker/fetch_configs.yml @@ -10,12 +10,11 @@ wait_for path="{{ playbook_dir }}/{{ fetch_directory }}/docker_mon_files/{{ item.0 }}" become: false - with_together: - - ceph_config_keys + with_together: "{{ ceph_config_keys }}" - name: stat for ceph config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false become: false failed_when: false @@ -29,5 +28,4 @@ group: root mode: 0644 changed_when: false - with_together: - - ceph_config_keys + with_together: "{{ ceph_config_keys }}" diff --git a/roles/ceph-osd/tasks/docker/start_docker_osd.yml b/roles/ceph-osd/tasks/docker/start_docker_osd.yml index 3bfdb3ade..a39493168 100644 --- a/roles/ceph-osd/tasks/docker/start_docker_osd.yml +++ b/roles/ceph-osd/tasks/docker/start_docker_osd.yml @@ -12,7 +12,7 @@ - name: verify if the disk was already prepared shell: "lsblk -o PARTLABEL {{ item }} | grep -sq 'ceph'" failed_when: false - with_items: ceph_osd_docker_devices + with_items: "{{ ceph_osd_docker_devices }}" register: osd_prepared # use shell rather than docker module @@ -34,8 +34,8 @@ -e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \ "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" with_together: - - ceph_osd_docker_devices - - osd_prepared.results + - "{{ ceph_osd_docker_devices }}" + - "{{ osd_prepared.results }}" when: - item.1.get("rc", 0) != 0 - ceph_osd_docker_prepare_env is defined @@ -58,8 +58,8 @@ -e KV_PORT={{kv_port}} \ "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" \ with_together: - - ceph_osd_docker_devices - - osd_prepared.results + - "{{ ceph_osd_docker_devices }}" + - "{{ osd_prepared.results }}" when: - item.1.get("rc", 0) != 0 - ceph_osd_docker_prepare_env is defined @@ -81,7 +81,7 @@ shell: systemctl enable ceph-osd@{{ item | basename }}.service failed_when: false changed_when: false - with_items: ceph_osd_docker_devices + with_items: "{{ ceph_osd_docker_devices }}" when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS' - name: reload systemd unit files @@ -96,7 +96,7 @@ state: started enabled: yes changed_when: false - with_items: ceph_osd_docker_devices + with_items: "{{ ceph_osd_docker_devices }}" when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS' - name: run the ceph osd docker image @@ -109,7 +109,7 @@ privileged: yes env: "OSD_DEVICE={{ item }},{{ ceph_osd_docker_extra_env }}" volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/etc/localtime:/etc/localtime:ro,/dev:/dev,/run:/run" - with_items: ceph_osd_docker_devices + with_items: "{{ ceph_osd_docker_devices }}" when: - ansible_os_family != 'RedHat' - ansible_os_family != 'CoreOS' @@ -125,9 +125,9 @@ privileged: yes env: "KV_TYPE={{kv_type}},KV_IP={{kv_endpoint}},OSD_DEVICE={{ item }},{{ ceph_osd_docker_extra_env }}" volumes: "/etc/localtime:/etc/localtime:ro,/dev/:/dev/" - with_items: ceph_osd_docker_devices + with_items: "{{ ceph_osd_docker_devices }}" when: - ansible_os_family != 'RedHat' - ansible_os_family != 'CoreOS' - osd_containerized_deployment_with_kv - + diff --git a/roles/ceph-osd/tasks/osd_fragment.yml b/roles/ceph-osd/tasks/osd_fragment.yml index cd70c5275..7cd0f36a1 100644 --- a/roles/ceph-osd/tasks/osd_fragment.yml +++ b/roles/ceph-osd/tasks/osd_fragment.yml @@ -1,7 +1,7 @@ --- - name: get osd path shell: "df | grep {{ item }} | awk '{print $6}'" - with_items: devices + with_items: "{{ devices }}" changed_when: false failed_when: false register: osd_path @@ -9,7 +9,7 @@ - name: get osd id command: cat {{ item.stdout }}/whoami - with_items: osd_path.results + with_items: "{{ osd_path.results }}" changed_when: false failed_when: false register: osd_id_non_dir_scenario @@ -17,7 +17,7 @@ - name: get osd id for directory scenario command: cat {{ item.stdout }}/whoami - with_items: osd_directories + with_items: "{{ osd_directories }}" changed_when: false failed_when: false register: osd_id_dir_scenario @@ -47,7 +47,7 @@ owner: "{{ dir_owner }}" group: "{{ dir_group }}" mode: "{{ activate_file_mode }}" - with_items: combined_osd_id.results + with_items: "{{ combined_osd_id.results }}" - name: copy {{ cluster }}.conf for assembling command: cp /etc/ceph/{{ cluster }}.conf /etc/ceph/ceph.d/ diff --git a/roles/ceph-osd/tasks/scenarios/bluestore.yml b/roles/ceph-osd/tasks/scenarios/bluestore.yml index 68ab01a61..2c5011c2b 100644 --- a/roles/ceph-osd/tasks/scenarios/bluestore.yml +++ b/roles/ceph-osd/tasks/scenarios/bluestore.yml @@ -12,7 +12,7 @@ - name: automatic prepare osd disk(s) without partitions command: ceph-disk prepare --bluestore --cluster "{{ cluster }}" "/dev/{{ item.key }}" register: prepared_osds - with_dict: ansible_devices + with_dict: "{{ ansible_devices }}" when: - ansible_devices is defined - item.value.removable == "0" @@ -23,9 +23,9 @@ - name: manually prepare osd disk(s) command: ceph-disk prepare --bluestore --cluster "{{ cluster }}" "{{ item.2 }}" with_together: - - parted_results.results - - ispartition_results.results - - devices + - "{{ parted_results.results }}" + - "{{ ispartition_results.results }}" + - "{{ devices }}" when: - not item.0.get("skipped") - not item.1.get("skipped") diff --git a/roles/ceph-osd/tasks/scenarios/dmcrypt-dedicated-journal.yml b/roles/ceph-osd/tasks/scenarios/dmcrypt-dedicated-journal.yml index f44407ba4..04d3a7b42 100644 --- a/roles/ceph-osd/tasks/scenarios/dmcrypt-dedicated-journal.yml +++ b/roles/ceph-osd/tasks/scenarios/dmcrypt-dedicated-journal.yml @@ -12,10 +12,10 @@ - name: prepare osd disk(s) command: "ceph-disk prepare --dmcrypt --cluster {{ cluster }} {{ item.2 }} {{ item.3 }}" with_together: - - parted_results.results - - ispartition_results.results - - devices - - raw_journal_devices + - "{{ parted_results.results }}" + - "{{ ispartition_results.results }}" + - "{{ devices }}" + - "{{ raw_journal_devices }}" changed_when: false when: - not item.0.get("skipped") diff --git a/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-collocation.yml b/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-collocation.yml index 642f193fb..a5431e692 100644 --- a/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-collocation.yml +++ b/roles/ceph-osd/tasks/scenarios/dmcrypt-journal-collocation.yml @@ -11,7 +11,7 @@ # failed, this is why we check if the device is a partition too. - name: automatic prepare osd disk(s) without partitions (dmcrypt) command: ceph-disk prepare --dmcrypt --cluster "{{ cluster }}" "/dev/{{ item.key }}" - with_dict: ansible_devices + with_dict: "{{ ansible_devices }}" when: - ansible_devices is defined - item.value.removable == "0" @@ -22,9 +22,9 @@ - name: manually prepare osd disk(s) (dmcrypt) command: ceph-disk prepare --dmcrypt --cluster "{{ cluster }}" "{{ item.2 }}" with_together: - - parted_results.results - - ispartition_results.results - - devices + - "{{ parted_results.results }}" + - "{{ ispartition_results.results }}" + - "{{ devices }}" when: - not item.0.get("skipped") - not item.1.get("skipped") diff --git a/roles/ceph-osd/tasks/scenarios/journal_collocation.yml b/roles/ceph-osd/tasks/scenarios/journal_collocation.yml index ba0fbb41f..7d286983e 100644 --- a/roles/ceph-osd/tasks/scenarios/journal_collocation.yml +++ b/roles/ceph-osd/tasks/scenarios/journal_collocation.yml @@ -12,7 +12,7 @@ - name: automatic prepare osd disk(s) without partitions command: ceph-disk prepare --cluster "{{ cluster }}" "/dev/{{ item.key }}" register: prepared_osds - with_dict: ansible_devices + with_dict: "{{ ansible_devices }}" when: - ansible_devices is defined - item.value.removable == "0" @@ -23,9 +23,9 @@ - name: manually prepare osd disk(s) command: "ceph-disk prepare --cluster {{ cluster }} {{ item.2 }}" with_together: - - parted_results.results - - ispartition_results.results - - devices + - "{{ parted_results.results }}" + - "{{ ispartition_results.results }}" + - "{{ devices }}" when: - not item.0.get("skipped") - not item.1.get("skipped") diff --git a/roles/ceph-osd/tasks/scenarios/osd_directory.yml b/roles/ceph-osd/tasks/scenarios/osd_directory.yml index 9cad4cfdf..899af7d33 100644 --- a/roles/ceph-osd/tasks/scenarios/osd_directory.yml +++ b/roles/ceph-osd/tasks/scenarios/osd_directory.yml @@ -10,20 +10,20 @@ state: directory owner: "{{ dir_owner }}" group: "{{ dir_group }}" - with_items: osd_directories + with_items: "{{ osd_directories }}" # NOTE (leseb): the prepare process must be parallelized somehow... # if you have 64 disks with 4TB each, this will take a while # since Ansible will sequential process the loop - name: prepare OSD disk(s) command: "ceph-disk prepare --cluster {{ cluster }} {{ item }}" - with_items: osd_directories + with_items: "{{ osd_directories }}" changed_when: false when: osd_directory - name: activate OSD(s) command: "ceph-disk activate {{ item }}" - with_items: osd_directories + with_items: "{{ osd_directories }}" changed_when: false - name: start and add that the OSD service to the init sequence diff --git a/roles/ceph-rbd-mirror/defaults/main.yml b/roles/ceph-rbd-mirror/defaults/main.yml index 2292a238a..6ecf8acde 100644 --- a/roles/ceph-rbd-mirror/defaults/main.yml +++ b/roles/ceph-rbd-mirror/defaults/main.yml @@ -3,6 +3,7 @@ # SETUP # ######### + # NOTE (leseb): the rbd-mirror daemon needs a user to start # because it has to authenticate with the local cluster. # By default, using the admin user is fine, so you should not @@ -41,3 +42,4 @@ ceph_rbd_mirror_docker_username: ceph ceph_rbd_mirror_docker_imagename: daemon ceph_rbd_mirror_docker_image_tag: latest ceph_docker_on_openstack: false +ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-rbd-mirror/tasks/docker/checks.yml b/roles/ceph-rbd-mirror/tasks/docker/checks.yml index 53ea48053..09cb57b57 100644 --- a/roles/ceph-rbd-mirror/tasks/docker/checks.yml +++ b/roles/ceph-rbd-mirror/tasks/docker/checks.yml @@ -13,7 +13,7 @@ - name: stat for ceph config and keys stat: path: "{{ item }}" - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false failed_when: false register: statleftover @@ -22,6 +22,6 @@ fail: msg: "looks like no cluster is running but ceph files are present, please remove them" with_together: - - ceph_config_keys - - statleftover.results + - "{{ ceph_config_keys }}" + - "{{ statleftover.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-rbd-mirror/tasks/docker/fetch_configs.yml b/roles/ceph-rbd-mirror/tasks/docker/fetch_configs.yml index 91afa69fa..b2d3b6c82 100644 --- a/roles/ceph-rbd-mirror/tasks/docker/fetch_configs.yml +++ b/roles/ceph-rbd-mirror/tasks/docker/fetch_configs.yml @@ -9,7 +9,7 @@ - name: stat for ceph config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false become: false failed_when: false @@ -24,6 +24,6 @@ mode: 0644 changed_when: false with_together: - - ceph_config_keys - - statconfig.results + - "{{ ceph_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-restapi/defaults/main.yml b/roles/ceph-restapi/defaults/main.yml index cfe565922..b93605b15 100644 --- a/roles/ceph-restapi/defaults/main.yml +++ b/roles/ceph-restapi/defaults/main.yml @@ -18,3 +18,4 @@ ceph_restapi_docker_imagename: daemon ceph_restapi_docker_image_tag: latest ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables ceph_docker_on_openstack: false +ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-restapi/tasks/docker/fetch_configs.yml b/roles/ceph-restapi/tasks/docker/fetch_configs.yml index 8cbdc1d31..ac369b384 100644 --- a/roles/ceph-restapi/tasks/docker/fetch_configs.yml +++ b/roles/ceph-restapi/tasks/docker/fetch_configs.yml @@ -7,7 +7,7 @@ - name: stat for ceph config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false become: false ignore_errors: true @@ -22,6 +22,6 @@ mode: 0644 changed_when: false with_together: - - ceph_config_keys - - statconfig.results + - "{{ ceph_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-rgw/defaults/main.yml b/roles/ceph-rgw/defaults/main.yml index 3b9282e36..c47f7c60e 100644 --- a/roles/ceph-rgw/defaults/main.yml +++ b/roles/ceph-rgw/defaults/main.yml @@ -36,3 +36,4 @@ ceph_rgw_docker_imagename: daemon ceph_rgw_docker_image_tag: latest ceph_rgw_docker_extra_env: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables ceph_docker_on_openstack: false +ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-rgw/tasks/docker/checks.yml b/roles/ceph-rgw/tasks/docker/checks.yml index 53ea48053..09cb57b57 100644 --- a/roles/ceph-rgw/tasks/docker/checks.yml +++ b/roles/ceph-rgw/tasks/docker/checks.yml @@ -13,7 +13,7 @@ - name: stat for ceph config and keys stat: path: "{{ item }}" - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false failed_when: false register: statleftover @@ -22,6 +22,6 @@ fail: msg: "looks like no cluster is running but ceph files are present, please remove them" with_together: - - ceph_config_keys - - statleftover.results + - "{{ ceph_config_keys }}" + - "{{ statleftover.results }}" when: item.1.stat.exists == true diff --git a/roles/ceph-rgw/tasks/docker/copy_configs.yml b/roles/ceph-rgw/tasks/docker/copy_configs.yml index 8e91c2ffe..10e705220 100644 --- a/roles/ceph-rgw/tasks/docker/copy_configs.yml +++ b/roles/ceph-rgw/tasks/docker/copy_configs.yml @@ -13,7 +13,7 @@ - name: stat for config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: rgw_config_keys + with_items: "{{ rgw_config_keys }}" changed_when: false become: false failed_when: false @@ -28,8 +28,8 @@ dest: "{{ fetch_directory }}/docker_mon_files/var/lib/ceph/radosgw/keyring" flat: yes with_together: - - rgw_config_keys - - statconfig.results + - "{{ rgw_config_keys }}" + - "{{ statconfig.results }}" when: - nfs_obj_gw - item.1.stat.exists == false diff --git a/roles/ceph-rgw/tasks/docker/fetch_configs.yml b/roles/ceph-rgw/tasks/docker/fetch_configs.yml index 9b0e9544e..19337240d 100644 --- a/roles/ceph-rgw/tasks/docker/fetch_configs.yml +++ b/roles/ceph-rgw/tasks/docker/fetch_configs.yml @@ -7,7 +7,7 @@ - name: stat for ceph config and keys local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }} - with_items: ceph_config_keys + with_items: "{{ ceph_config_keys }}" changed_when: false become: false ignore_errors: true @@ -22,6 +22,6 @@ mode: 0644 changed_when: false with_together: - - ceph_config_keys - - statconfig.results + - "{{ ceph_config_keys }}" + - "{{ statconfig.results }}" when: item.1.stat.exists == true