diff --git a/roles/cephadm/tasks/main.yml b/roles/cephadm/tasks/main.yml index 9856bfa4..1b043f34 100644 --- a/roles/cephadm/tasks/main.yml +++ b/roles/cephadm/tasks/main.yml @@ -12,12 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -# TODO: bump containers collection to avoid this -- name: Make sure docker is started - ansible.builtin.service: - name: docker - state: started - - name: Install packages ansible.builtin.apt: name: ["openssh-server", "cephadm"] @@ -32,75 +26,14 @@ ansible.builtin.user: name: cephadm shell: /bin/bash - create_home: yes + create_home: true - name: Allow "cephadm" user to have passwordless sudo ansible.builtin.lineinfile: path: /etc/sudoers.d/cephadm - state: present - create: yes + owner: root + group: root + mode: '0440' + create: true line: "cephadm ALL=(ALL) NOPASSWD:ALL" validate: 'visudo -cf %s' - -# TODO: install ssh key if bootstrapped? - -# - name: Install packages -# ansible.builtin.apt: -# name: ["ceph-common"] -# install_recommends: false - -# - name: Check Ceph cluster status -# delegate_to: groups[ceph_mon_group][0] -# run_once: true -# block: -# - name: Check ceph exists -# ansible.builtin.command: ceph status -# ignore_errors: true -# changed_when: false -# register: ceph_status - -# - name: Set global flag for adoption -# ansible.builtin.set_fact: -# ceph_adoption: ceph_status.rc == 0 and adopt_exists -# delegate_to: "{{ item }}" -# with_items: "{{ ansible_play_hosts }}" -# run_once: true - -# - name: Fail when custer exists but no plan to adopt it -# ansible.builtin.fail: -# msg: Existing cluster detected when adopt_exists set to false. -# when: -# - ceph_status.rc == 0 and not adopt_exists - -# # TODO: ADD skip on exists -# # But allow perform config overwrite (ceph_mon_conf_overrides) still - -# - name: Bootstrap cluster -# ansible.builtin.include_tasks: bootstrap-ceph.yml -# delegate_to: groups[ceph_mon_group][0] -# run_once: true -# when: -# - ceph_status.rc != 0 - -# - name: Adopt exists cluster -# ansible.builtin.include_tasks: adoption.yml -# delegate_to: groups[ceph_mon_group][0] -# run_once: true -# when: -# - ceph_adoption - -# - name: Set authorized key -# ansible.posix.authorized_key: -# user: root -# key: "{{ ceph_ssh_pub_key }}" -# state: present - -# - name: Add host to ceph cluster -# ansible.builtin.command: -# cmd: ceph orch host add "{{ inventory_hostname_short }} {{ ansible_all_ipv4_addresses | ansible.utils.ipaddr(ceph_mon_public_network) | first }}" -# changed_when: false - -# - name: Add _admin label to host -# ansible.builtin.command: -# cmd: ceph orch host label add "{{ inventory_hostname_short }}" _admin -# changed_when: false