pvc-ansible/roles/pvc/tasks/main.yml

61 lines
1.2 KiB
YAML
Raw Normal View History

2019-06-09 00:11:06 -04:00
---
2019-06-12 21:06:06 -04:00
# First-run check
- name: check if this is a new instance
shell: "echo 'bootstrapped' > /etc/pvc-pvc-install"
2019-06-12 21:06:06 -04:00
args:
creates: /etc/pvc-pvc-install
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
# General blacklisting of modules
2019-06-09 00:11:06 -04:00
- name: add module blacklist
template:
src: system/blacklist.j2
dest: /etc/modprobe.d/blacklist.conf
2019-06-12 21:06:06 -04:00
# Install base databases
- include: ceph/main.yml
2019-06-09 00:11:06 -04:00
tags: pvc-ceph
2019-06-12 21:06:06 -04:00
- include: zookeeper/main.yml
2019-06-09 00:11:06 -04:00
tags: pvc-zookeeper
2019-06-12 21:06:06 -04:00
- include: patroni/main.yml
tags: pvc-patroni
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
# 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
# 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