2023-09-01 15:42:19 -04:00
|
|
|
---
|
2023-09-01 15:42:19 -04:00
|
|
|
|
|
|
|
# First-run check
|
|
|
|
- name: check if this is a new instance
|
|
|
|
shell: "echo 'bootstrapped' > /etc/pvc-install"
|
|
|
|
args:
|
|
|
|
creates: /etc/pvc-install
|
|
|
|
register: newhost_check
|
2023-09-01 15:42:19 -04:00
|
|
|
tags: always
|
2023-09-01 15:42:19 -04:00
|
|
|
|
|
|
|
- name: set newhost fact
|
|
|
|
set_fact:
|
|
|
|
newhost: yes
|
|
|
|
when: newhost_check.changed
|
2023-09-01 15:42:19 -04:00
|
|
|
tags: always
|
2023-09-01 15:42:19 -04:00
|
|
|
|
|
|
|
- include: common/add_cluster_ips.yml
|
|
|
|
when: newhost is defined and newhost
|
2023-09-01 15:42:19 -04:00
|
|
|
tags: always
|
2023-09-01 15:42:19 -04:00
|
|
|
|
|
|
|
# General blacklisting of modules
|
2023-09-01 15:42:19 -04:00
|
|
|
- name: add module blacklist
|
|
|
|
template:
|
|
|
|
src: system/blacklist.j2
|
|
|
|
dest: /etc/modprobe.d/blacklist.conf
|
|
|
|
|
2023-09-01 15:42:19 -04:00
|
|
|
# Install base databases
|
|
|
|
- include: ceph/main.yml
|
2023-09-01 15:42:19 -04:00
|
|
|
tags: pvc-ceph
|
|
|
|
|
2023-09-01 15:42:19 -04:00
|
|
|
- include: zookeeper/main.yml
|
2023-09-01 15:42:19 -04:00
|
|
|
tags: pvc-zookeeper
|
|
|
|
|
2023-09-01 15:42:19 -04:00
|
|
|
- include: patroni/main.yml
|
|
|
|
tags: pvc-patroni
|
2023-09-01 15:42:19 -04:00
|
|
|
|
2023-09-01 15:42:19 -04:00
|
|
|
# Install core services
|
|
|
|
- include: libvirt/main.yml
|
2023-09-01 15:42:19 -04:00
|
|
|
tags: pvc-libvirt
|
|
|
|
|
2023-09-01 15:42:19 -04:00
|
|
|
- include: frr/main.yml
|
2023-09-01 15:42:19 -04:00
|
|
|
tags: pvc-frr
|
|
|
|
|
2023-09-01 15:42:19 -04:00
|
|
|
# Install PVC sequentially
|
|
|
|
- include: pvc/main.yml
|
2023-09-01 15:42:19 -04:00
|
|
|
tags: pvc-daemon
|
2023-09-01 15:42:19 -04:00
|
|
|
run_once: true
|
2023-09-01 15:42:19 -04:00
|
|
|
delegate_to: "{{ play_host }}"
|
2023-09-01 15:42:19 -04:00
|
|
|
with_items: "{{ play_hosts }}"
|
2023-09-01 15:42:19 -04:00
|
|
|
loop_control:
|
|
|
|
loop_var: play_host
|
2023-09-01 15:42:20 -04:00
|
|
|
|
|
|
|
- include: common/remove_cluster_ips.yml
|
|
|
|
when: newhost is defined and newhost
|
|
|
|
tags: always
|
|
|
|
|
|
|
|
- name: restart server on first install
|
|
|
|
shell: 'sleep 1 && shutdown -r now "Ansible updates triggered"'
|
|
|
|
async: 1
|
|
|
|
poll: 0
|
|
|
|
ignore_errors: yes
|
|
|
|
become: yes
|
|
|
|
when: newhost is defined and newhost
|
|
|
|
tags: always
|