69 lines
1.3 KiB
YAML
69 lines
1.3 KiB
YAML
---
|
|
- name: install pvc packages
|
|
apt:
|
|
name:
|
|
- pvc-daemon
|
|
- pvc-client-common
|
|
- pvc-client-cli
|
|
- pvc-client-api
|
|
- debootstrap
|
|
- ethtool
|
|
- jq
|
|
state: latest
|
|
|
|
- name: install pvc configurations
|
|
template:
|
|
src: pvc/{{ item }}.j2
|
|
dest: /etc/pvc/{{ item }}
|
|
notify:
|
|
- restart pvcd
|
|
with_items:
|
|
- pvcd.yaml
|
|
- pvc-api.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
|
|
|
|
- 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
|
|
|
|
- name: stop and disable unneccessary services
|
|
service:
|
|
name: "{{item }}"
|
|
state: stopped
|
|
enabled: no
|
|
with_items:
|
|
- pdns.service
|
|
- dnsmasq.service
|
|
|
|
- include: pvc/bootstrap.yml
|
|
when: bootstrap is defined and bootstrap
|
|
run_once: yes
|
|
|
|
- name: enable daemon services but don't start them
|
|
service:
|
|
name: "{{ item }}"
|
|
enabled: yes
|
|
with_items:
|
|
- pvc-flush.service
|
|
- pvcd.service
|
|
- pvcd.target
|
|
|
|
- name: install daily vacuum script
|
|
template:
|
|
src: pvc/pvc-vacuum.j2
|
|
dest: /etc/cron.daily/pvc-vacuum
|
|
mode: 0755
|
|
|
|
- meta: flush_handlers
|