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

52 lines
1.2 KiB
YAML

---
- name: add floating IP address to upstream interface
command: ip address add {{ pvc_upstream_floatingip }}/{{ pvc_upstream_netmask }} dev {{ pvc_upstream_device }}
ignore_errors: yes
- name: apply database migrations
command: /usr/share/pvc/pvc-api-db-upgrade
- name: start the API daemon
service:
name: pvcapid.service
state: started
- name: wait 5s for daemon to initialize
pause:
seconds: 5
- name: initialize a fresh PVC cluster
command: pvc -c local task init -y
- name: wait 5s for cluster to stabilize
pause:
seconds: 5
- name: stop the API daemon
service:
name: pvcapid.service
state: stopped
- name: remove floating IP address to upstream interface
command: ip address delete {{ pvc_upstream_floatingip }}/{{ pvc_upstream_netmask }} dev {{ pvc_upstream_device }}
ignore_errors: yes
- name: stop and disable unneccessary services
service:
name: "{{item }}"
state: stopped
enabled: no
with_items:
- pdns.service
- dnsmasq.service
- name: ensure services are enabled but stopped pending reboot
service:
name: "{{ item }}"
state: stopped
enabled: yes
with_items:
- pvc-flush.service
- pvcnoded.service
- pvc.target