-
Notifications
You must be signed in to change notification settings - Fork 2
/
chia-playbook.yml
39 lines (33 loc) · 1017 Bytes
/
chia-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
- name: Backup fork
hosts: "{{ target }}"
gather_facts: false
become: true
tasks:
- name: Set action
set_fact:
action: "{{ ( action | default('help') ) | lower }}"
action_list:
- "install"
- "remove"
- "upgrade"
- "backup"
- "restore"
- "help"
backup_user: "{{ ( backup_user | default ('true') ) | lower }}"
configure_plots: "{{ ( configure_plots | default ('true') ) | lower }}"
- name: Validate action
assert:
that:
- action | lower in action_list
- name: Validate required vars for installation
assert:
that:
- fork_mnemonic is defined and fork_mnemonic | length > 0
when: action in ("install","upgrade")
- name: Load fork vars
include_vars: "vars/{{ fork_name }}_vars.yml"
- name: Load local vars
include_vars: "local_vars.yml"
- name: Include tasks
include_tasks: "tasks/action_{{ action }}.yml"