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

83 lines
1.8 KiB
YAML
Raw Normal View History

2023-09-01 15:42:19 -04:00
---
- name: install pvc packages (all)
2023-09-01 15:42:19 -04:00
apt:
name:
- pvc-daemon-node
- pvc-daemon-health
- pvc-daemon-worker
- pvc-daemon-common
2023-09-01 15:42:21 -04:00
- pvc-client-cli
2023-09-01 15:42:21 -04:00
- ethtool
2023-09-01 15:42:21 -04:00
- jq
state: present
register: apt_res
retries: 5
until: apt_res is success
- name: install pvc packages (coordinators only)
apt:
name:
- pvc-daemon-api
# default provisioner script helper programs (pvcworkerd)
2023-09-01 15:42:29 -04:00
- debootstrap
- rinse
state: present
when: is_coordinator
2023-09-01 15:42:30 -04:00
register: apt_res
retries: 5
until: apt_res is success
2023-09-01 15:42:19 -04:00
- name: install pvc daemon configuration
template:
2023-12-01 01:43:14 -05:00
src: "pvc/{{ item }}.j2"
dest: "/etc/pvc/{{ item }}"
mode: 0640
with_items:
- pvc.conf
- name: remove obsolete pvc daemon configurations
file:
dest: "/etc/pvc/{{ item }}"
state: absent
with_items:
- pvcnoded.yaml
- pvcapid.yaml
- autobackup.yaml
- name: install API SSL certificate file
copy:
content: "{{ pvc_api_ssl_cert }}"
dest: /etc/pvc/api-cert.pem
mode: 0644
no_log: True
when: pvc_api_enable_ssl and not pvc_api_ssl_cert_path
- name: install API SSL key file
copy:
content: "{{ pvc_api_ssl_key }}"
dest: /etc/pvc/api-key.pem
mode: 0640
no_log: True
when: pvc_api_enable_ssl and not pvc_api_ssl_key_path
2023-09-01 15:42:19 -04:00
2023-09-01 15:42:26 -04:00
- name: install check_mk agent check
template:
src: pvc/pvc_status.j2
dest: /usr/lib/check_mk_agent/plugins/pvc_status
mode: 0755
2023-09-01 15:42:20 -04:00
- include: pvc/bootstrap.yml
2023-09-01 15:42:19 -04:00
run_once: yes
when: do_bootstrap is defined and do_bootstrap and is_coordinator
2023-09-01 15:42:19 -04:00
2023-09-01 15:42:19 -04:00
- meta: flush_handlers
- name: ensure services are started and running
service:
name: "{{ item }}"
state: started
enabled: yes
with_items:
- pvcnoded
when: newhost is defined and newhost