39 lines
916 B
YAML
39 lines
916 B
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: '{{ cephadm_checksum }}'
|
|
dest: /usr/local/bin/cephadm
|
|
mode: 0755
|
|
|
|
- include_tasks: firewall.yml
|