Added Ansible playbooks
This commit is contained in:
1 parent
b1c16a00ff
commit
2ca06e8cc6
4 files changed
+192
No files matched your search
@@ -0,0 +1,51 @@
|
||||
- name: Stop Broadcast
|
||||
ansible.builtin.import_playbook: stop.yaml
|
||||
|
||||
- name: Uninstall Broadcast
|
||||
hosts: Lothlorien
|
||||
tasks:
|
||||
- name: Remove Broadcast bedroom speaker audio Docker volume
|
||||
community.docker.docker_volume:
|
||||
volume_name: broadcast-bedroom-speaker-audio
|
||||
state: absent
|
||||
- name: Remove Broadcast bedroom speaker audio Docker volume
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /data/broadcast-bedroom-speaker-audio
|
||||
state: absent
|
||||
|
||||
- name: Read homelab config
|
||||
ansible.builtin.slurp:
|
||||
src: '{{ansible_user_dir}}/.homelab.json'
|
||||
register: homelab_config_file
|
||||
- name: Set homelab_config variable
|
||||
ansible.builtin.set_fact:
|
||||
homelab_config: '{{homelab_config_file.content|b64decode|from_json}}'
|
||||
|
||||
- name: Delete from Postgres table service_data
|
||||
community.postgresql.postgresql_query:
|
||||
login_host: '{{homelab_config.database.host}}'
|
||||
login_user: '{{homelab_config.database.user}}'
|
||||
login_password: '{{homelab_config.database.password}}'
|
||||
db: '{{homelab_config.database.name}}'
|
||||
query: 'DELETE FROM service_data WHERE service = %s;'
|
||||
positional_args:
|
||||
- broadcast
|
||||
- name: Delete from Postgres table service_port
|
||||
community.postgresql.postgresql_query:
|
||||
login_host: '{{homelab_config.database.host}}'
|
||||
login_user: '{{homelab_config.database.user}}'
|
||||
login_password: '{{homelab_config.database.password}}'
|
||||
db: '{{homelab_config.database.name}}'
|
||||
query: 'DELETE FROM service_port WHERE service = %s;'
|
||||
positional_args:
|
||||
- broadcast
|
||||
- name: Delete from Postgres table service
|
||||
community.postgresql.postgresql_query:
|
||||
login_host: '{{homelab_config.database.host}}'
|
||||
login_user: '{{homelab_config.database.user}}'
|
||||
login_password: '{{homelab_config.database.password}}'
|
||||
db: '{{homelab_config.database.name}}'
|
||||
query: 'DELETE FROM service WHERE name = %s;'
|
||||
positional_args:
|
||||
- broadcast
|
||||
Reference in new issue
Block a user