2019-06-09 00:11:06 -04:00
|
|
|
---
|
2019-06-12 21:06:06 -04:00
|
|
|
|
2021-11-11 17:14:34 -05:00
|
|
|
# Set this_node fact
|
2019-07-11 19:58:56 -04:00
|
|
|
- set_fact:
|
2021-11-11 17:14:34 -05:00
|
|
|
this_node: "{{ inventory_hostname.split('.')[0] }}"
|
|
|
|
tags: always
|
|
|
|
|
|
|
|
# Set coordinator state fact
|
|
|
|
- set_fact:
|
|
|
|
is_coordinator: "{% for node in pvc_nodes if node.hostname == this_node %}{{ node.is_coordinator }}{% endfor %}"
|
2019-07-11 19:58:56 -04:00
|
|
|
tags: always
|
|
|
|
|
2019-06-12 21:06:06 -04:00
|
|
|
# First-run check
|
|
|
|
- name: check if this is a new instance
|
2019-06-18 10:47:40 -04:00
|
|
|
shell: "echo 'bootstrapped' > /etc/pvc-install.pvc"
|
2019-06-12 21:06:06 -04:00
|
|
|
args:
|
2019-06-18 10:47:40 -04:00
|
|
|
creates: /etc/pvc-install.pvc
|
2019-06-12 21:06:06 -04:00
|
|
|
register: newhost_check
|
2019-06-12 23:22:47 -04:00
|
|
|
tags: always
|
2019-06-12 21:06:06 -04:00
|
|
|
|
|
|
|
- name: set newhost fact
|
|
|
|
set_fact:
|
|
|
|
newhost: yes
|
|
|
|
when: newhost_check.changed
|
2019-06-12 23:22:47 -04:00
|
|
|
tags: always
|
2019-06-12 21:06:06 -04:00
|
|
|
|
|
|
|
- include: common/add_cluster_ips.yml
|
|
|
|
when: newhost is defined and newhost
|
2019-06-12 23:22:47 -04:00
|
|
|
tags: always
|
2019-06-12 21:06:06 -04:00
|
|
|
|
2021-09-26 14:49:22 -04:00
|
|
|
# Install system tweaks
|
|
|
|
- include: system/main.yml
|
|
|
|
tags: pvc-system
|
2019-08-11 15:41:10 -04:00
|
|
|
|
2019-07-11 19:58:56 -04:00
|
|
|
# Install base databases (coordinators only)
|
2019-06-12 21:06:06 -04:00
|
|
|
- include: ceph/main.yml
|
2019-06-09 00:11:06 -04:00
|
|
|
tags: pvc-ceph
|
2019-07-11 19:58:56 -04:00
|
|
|
when: is_coordinator
|
2019-06-09 00:11:06 -04:00
|
|
|
|
2019-06-12 21:06:06 -04:00
|
|
|
- include: zookeeper/main.yml
|
2019-06-09 00:11:06 -04:00
|
|
|
tags: pvc-zookeeper
|
2019-07-11 19:58:56 -04:00
|
|
|
when: is_coordinator
|
2019-06-09 00:11:06 -04:00
|
|
|
|
2019-06-12 21:06:06 -04:00
|
|
|
- include: patroni/main.yml
|
|
|
|
tags: pvc-patroni
|
2019-07-11 19:58:56 -04:00
|
|
|
when: is_coordinator
|
2019-06-11 16:31:55 -04:00
|
|
|
|
2019-06-12 21:06:06 -04:00
|
|
|
# Install core services
|
|
|
|
- include: libvirt/main.yml
|
2019-06-09 00:11:06 -04:00
|
|
|
tags: pvc-libvirt
|
|
|
|
|
2019-06-12 21:06:06 -04:00
|
|
|
- include: frr/main.yml
|
2019-06-09 00:11:06 -04:00
|
|
|
tags: pvc-frr
|
|
|
|
|
2019-06-16 19:17:41 -04:00
|
|
|
# Install PVC daemon
|
2019-06-12 21:06:06 -04:00
|
|
|
- include: pvc/main.yml
|
2019-06-12 23:22:47 -04:00
|
|
|
tags: pvc-daemon
|
2019-06-16 03:59:25 -04:00
|
|
|
|
2022-11-12 02:11:12 -05:00
|
|
|
# Install CPU tuning
|
|
|
|
- include: cputuning/main.yml
|
|
|
|
tags: pvc-cputuning
|
2022-11-15 15:37:44 -05:00
|
|
|
when: ansible_distribution_major_version|int >= 11 and cpu_tuning is defined
|
2022-11-12 02:11:12 -05:00
|
|
|
|
2019-06-16 03:59:25 -04:00
|
|
|
- name: restart server on first install
|
2019-06-16 19:17:41 -04:00
|
|
|
shell: 'sleep 3 && shutdown -r now "Ansible updates triggered"'
|
2019-06-16 03:59:25 -04:00
|
|
|
async: 1
|
|
|
|
poll: 0
|
|
|
|
ignore_errors: yes
|
|
|
|
become: yes
|
|
|
|
when: newhost is defined and newhost
|
|
|
|
tags: always
|