servers/roles/ceph/tasks/main.yml
Timotej Lazar ce7903e43a ceph: improve cluster setup
Remove separate NetBox lookups. Explicitly allow connections between
cluster nodes. Tigthen temporary allowed IPv6 ranges.
2024-03-01 08:45:51 +01:00

39 lines
1 KiB
YAML

- name: Get all nodes in my cluster
set_fact:
nodes: "{{ groups['cluster_'+cluster] | map('extract', hostvars) }}"
- name: Configure /etc/hosts
template:
dest: /etc/hosts
src: hosts.j2
- name: Generate my SSH key
openssh_keypair:
path: /root/.ssh/id_ed25519
type: ed25519
comment: "root@{{ inventory_hostname }}"
register: my_key
- name: Deploy my key on other nodes
authorized_key:
user: root
key: "{{ my_key.public_key }}"
comment: "{{ my_key.comment }}"
delegate_to: "{{ item }}"
loop: "{{ nodes | map(attribute='inventory_hostname') }}"
- name: Install required packages
package:
name:
- lvm2
- podman
- name: Install cephadm script
get_url:
url: https://download.ceph.com/rpm-{{ ceph_version }}/el9/noarch/cephadm
checksum: sha512:dc9bfed5b56c3756720e935a1520ccffe4ecf5e37502fe60a6ff835b98da8afe23a0ecab3770698c10ce1278004c788091eed9b4651d1c52f8d05729b4036c12
dest: /usr/local/bin/cephadm
mode: 0755
- include_tasks: firewall.yml