--- - name: enable extras repo for centos ini_file: dest: /etc/yum.repos.d/CentOS-Base.repo section: extras option: enabled value: 1 when: ansible_distribution == 'CentOS' - name: install rependencies package: name: parted state: present - name: create bootstrap-osd and osd directories file: path: "{{ item }}" state: directory owner: "{{ dir_owner }}" group: "{{ dir_group }}" mode: "{{ dir_mode }}" when: cephx with_items: - /var/lib/ceph/bootstrap-osd/ - /var/lib/ceph/osd/ - name: copy ceph admin key when using dmcrypt set_fact: copy_admin_key: true when: - dmcrypt_journal_collocation or dmcrypt_dedicated_journal - name: copy osd bootstrap key copy: src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}" dest: "{{ item.name }}" owner: "{{ key_owner }}" group: "{{ key_group }}" mode: "{{ key_mode }}" with_items: - { name: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true } - { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } when: - cephx - item.copy_key|bool