feat: Swapped tofu init scripting for ansible scripting
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: Bootstrap newly created servers (idempotent, safe to re-run)
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
become: false
|
||||
vars:
|
||||
ansible_user: root
|
||||
roles:
|
||||
- bootstrap
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Render templates and sync service definitions to each host
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
roles:
|
||||
- deploy
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
- ansible.builtin.import_playbook: bootstrap.yml
|
||||
- ansible.builtin.import_playbook: deploy.yml
|
||||
- ansible.builtin.import_playbook: spinup.yml
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Stop every compose stack on each host and prune Docker resources
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
vars_prompt:
|
||||
- name: confirm
|
||||
prompt: >-
|
||||
This runs spindown.sh (docker compose down, then a full
|
||||
docker image/volume prune -a) on the targeted host(s).
|
||||
Type 'yes' to continue
|
||||
private: false
|
||||
tasks:
|
||||
- name: Abort unless confirmed
|
||||
ansible.builtin.fail:
|
||||
msg: Aborted.
|
||||
when: confirm != 'yes'
|
||||
|
||||
- name: Run spindown.sh
|
||||
ansible.builtin.command: ./spindown.sh
|
||||
args:
|
||||
chdir: "/home/{{ deploy_user }}/services/{{ service_group }}"
|
||||
register: _spindown
|
||||
changed_when: true
|
||||
|
||||
- name: Show spindown output
|
||||
ansible.builtin.debug:
|
||||
var: _spindown.stdout_lines
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
- name: Start every compose stack on each host, in the order spinup.sh defines
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Run spinup.sh
|
||||
ansible.builtin.command: ./spinup.sh
|
||||
args:
|
||||
chdir: "/home/{{ deploy_user }}/services/{{ service_group }}"
|
||||
register: _spinup
|
||||
changed_when: true
|
||||
|
||||
- name: Show spinup output
|
||||
ansible.builtin.debug:
|
||||
var: _spinup.stdout_lines
|
||||
Reference in New Issue
Block a user