Skip to content

Commit

Permalink
fix: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Dec 5, 2023
1 parent 7a08857 commit a99f084
Showing 1 changed file with 5 additions and 72 deletions.
77 changes: 5 additions & 72 deletions roles/cephadm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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

0 comments on commit a99f084

Please sign in to comment.