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