Joshua M. Boniface d6cb28b639 Add immutability to PVC subrole
1. Remove the obsolete pvc-vacuum script install.

2. Remove notifies when modifying configs; we do not want to restart the
daemons uncontrolled.

3. Add bootstrap check to package installs so they only happen on
bootstrap.

This ensures this part of the role, on re-runs, will *only* update
configs and not actually touch the running daemon. This makes it safe to
run before a oneshot/update-pvc-daemons.yml playbook run.
2023-09-01 15:42:28 -04:00

65 lines
1.4 KiB
YAML

---
- name: install pvc packages
apt:
name:
- pvc-daemon-node
- pvc-daemon-api
- pvc-daemon-common
- pvc-client-cli
- debootstrap
- ethtool
- jq
state: latest
when: bootstrap is defined and bootstrap
- name: install pvc node daemon configuration
template:
src: pvc/{{ item }}.j2
dest: /etc/pvc/{{ item }}
with_items:
- pvcnoded.yaml
- name: install pvc api daemon configuration
template:
src: pvc/{{ item }}.j2
dest: /etc/pvc/{{ item }}
with_items:
- pvcapid.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
- name: install check_mk agent check
template:
src: pvc/pvc_status.j2
dest: /usr/lib/check_mk_agent/plugins/pvc_status
mode: 0755
- include: pvc/bootstrap.yml
run_once: yes
when: bootstrap is defined and bootstrap and is_coordinator
- meta: flush_handlers
- name: ensure services are started and running
service:
name: "{{ item }}"
state: started
enabled: yes
with_items:
- pvcnoded
when: bootstrap is not defined or not bootstrap