From ee5f8ffe92612fe66c5c41d881bfff4e30499dbb Mon Sep 17 00:00:00 2001 From: Salt Date: Fri, 19 Nov 2021 20:38:20 -0600 Subject: [PATCH] Make a box to move Stalin back home where he belongs --- playbooks/home_app.yml | 22 ++++++++++++++++++++++ playbooks/home_db.yml | 8 ++++++-- playbooks/prod_db.yml | 4 ---- playbooks/prod_web.yml | 1 - playbooks/tasks/app/gulagbot.yml | 2 +- site.yml | 1 + 6 files changed, 30 insertions(+), 8 deletions(-) create mode 100755 playbooks/home_app.yml diff --git a/playbooks/home_app.yml b/playbooks/home_app.yml new file mode 100755 index 0000000..c3561b6 --- /dev/null +++ b/playbooks/home_app.yml @@ -0,0 +1,22 @@ +#!/usr/bin/env ansible-playbook +# vim:ft=ansible: +# Webservers +--- +- hosts: vm-bot-1.home.mgmt.desu.ltd + module_defaults: + docker_container: + state: started + restart_policy: unless-stopped + pull: yes + tasks: + - name: include tasks for applications + include_tasks: tasks/{{ item }} + with_items: + - app/gulagbot.yml + tags: [ always ] + roles: + - role: backup + vars: + backup_s3backup_list_extra: + - /data + tags: [ backup ] diff --git a/playbooks/home_db.yml b/playbooks/home_db.yml index 2e75cf5..e04fe5e 100755 --- a/playbooks/home_db.yml +++ b/playbooks/home_db.yml @@ -12,7 +12,7 @@ vars: postgresql_global_config_options: - option: listen_addresses - value: 192.168.103.1,172.23.103.1,127.0.0.1 + value: "*" postgresql_hba_entries: - { type: local, database: all, user: postgres, auth_method: peer } - { type: local, database: all, user: all, auth_method: md5 } @@ -23,7 +23,11 @@ # Allow hosts over zerotier - { type: host, database: all, user: all, address: '172.23.0.0/16', auth_method: md5 } postgresql_users: + - name: gulagbot-desultd + password: "{{ secret_gulagbot_db_pass }}" - name: nagios password: "{{ secret_postgresql_monitoring_password }}" - postgresql_databases: [] + postgresql_databases: + - name: gulagbot-desultd + owner: gulagbot-desultd tags: [ home, db, psql ] diff --git a/playbooks/prod_db.yml b/playbooks/prod_db.yml index 82d2f29..b5d8711 100755 --- a/playbooks/prod_db.yml +++ b/playbooks/prod_db.yml @@ -25,8 +25,6 @@ postgresql_users: - name: gitea-desultd password: "{{ secret_gitea_db_pass }}" - - name: gulagbot-desultd - password: "{{ secret_gulagbot_db_pass }}" - name: gulagbot-test password: "{{ secret_gulagbot_test_db_pass }}" - name: nagios @@ -44,8 +42,6 @@ postgresql_databases: - name: gitea-desultd owner: gitea-desultd - - name: gulagbot-desultd - owner: gulagbot-desultd - name: gulagbot-test owner: gulagbot-test - name: netbox-desultd diff --git a/playbooks/prod_web.yml b/playbooks/prod_web.yml index 3be1e4f..a8c98cc 100755 --- a/playbooks/prod_web.yml +++ b/playbooks/prod_web.yml @@ -15,7 +15,6 @@ - name: include tasks for applications include_tasks: tasks/{{ item }} with_items: - - app/gulagbot.yml - app/redis.yml - web/9iron.yml - web/desultd.yml diff --git a/playbooks/tasks/app/gulagbot.yml b/playbooks/tasks/app/gulagbot.yml index b7c387a..a60edf5 100644 --- a/playbooks/tasks/app/gulagbot.yml +++ b/playbooks/tasks/app/gulagbot.yml @@ -5,7 +5,7 @@ image: rehashedsalt/gulagbot:latest env: DISCORD_TOKEN: "{{ secret_gulagbot_discord_token }}" - PGHOST: 192.168.164.156 + PGHOST: 192.168.1.29 PGDATABASE: gulagbot-desultd PGUSER: gulagbot-desultd PGPASSWORD: "{{ secret_gulagbot_db_pass }}" diff --git a/site.yml b/site.yml index 43f01cb..8e343cb 100755 --- a/site.yml +++ b/site.yml @@ -20,6 +20,7 @@ # Home configuration - import_playbook: playbooks/home_db.yml - import_playbook: playbooks/home_fs.yml +- import_playbook: playbooks/home_app.yml - import_playbook: playbooks/home_media.yml - import_playbook: playbooks/home_automation.yml # Production configuration