80 lines
2.1 KiB
YAML
80 lines
2.1 KiB
YAML
- name: set FQDN
|
|
hostname:
|
|
name: "{{ inventory_hostname }}"
|
|
use: systemd
|
|
|
|
- name: set root password
|
|
ansible.builtin.user:
|
|
name: root
|
|
password: "{{ root_pass | password_hash('sha512')}}"
|
|
|
|
- name: set date and time manually to be able to interact with repo=
|
|
command: "{{ item }}"
|
|
loop:
|
|
- date -s "{{ now(utc=true,fmt='%Y-%m-%d %H:%M:%S') }}"
|
|
- hwclock --systohc
|
|
|
|
- import_role:
|
|
name: ansible-netplan
|
|
|
|
- name: update repos sources|sshd_config|repo_key
|
|
ansible.builtin.copy:
|
|
src: "{{ item.name }}"
|
|
dest: "{{ item.dest }}"
|
|
loop:
|
|
- {name: ceph.list,dest: /etc/apt/sources.list.d/ceph.list}
|
|
- {name: sshd_config,dest: /etc/ssh/sshd_config}
|
|
- {name: ceph.gpg,dest: /usr/share/keyrings/ceph.gpg}
|
|
|
|
- name: Templating sources lists
|
|
ansible.builtin.template:
|
|
src: "{{ item.name }}"
|
|
dest: "{{ item.dest }}"
|
|
loop:
|
|
- { name: sources.list.j2,dest: /etc/apt/sources.list }
|
|
- { name: ceph.list.j2,dest: /etc/apt/sources.list.d/ceph.list }
|
|
|
|
- name: install packages
|
|
apt:
|
|
pkg:
|
|
- ceph-common
|
|
- cephadm
|
|
- lvm2
|
|
- podman
|
|
- chrony
|
|
- mc
|
|
- linux-tools-common
|
|
- linux-tools-`uname -r`
|
|
- ipmitool
|
|
state: present
|
|
update_cache: yes
|
|
|
|
- name: Setup ntp client
|
|
template:
|
|
src: chrony.yaml.j2
|
|
dest: /etc/chrony/chrony.conf
|
|
|
|
- name: setup ipmi
|
|
import_role:
|
|
name: ansible-ipmitool
|
|
|
|
- name: Templating cluster settings files
|
|
template:
|
|
src: "{{ item.name }}"
|
|
dest: "{{ item.dest }}"
|
|
trim_blocks: true
|
|
lstrip_blocks: true
|
|
loop:
|
|
- { name: "cluster_spec.yml.j2", dest: "/root/cluster_spec.yml" }
|
|
- { name: "initial-ceph.j2", dest: "/root/initial-ceph.conf" }
|
|
run_once: true
|
|
delegate_to: "{{ ansible_play_hosts[0] }}"
|
|
|
|
- name: restart_services
|
|
ansible.builtin.systemd:
|
|
state: restarted
|
|
name: "{{ item }}"
|
|
loop:
|
|
- sshd
|
|
- chronyd
|