From 8191a5b95d22a75a9b1987a94838c46611cce4e6 Mon Sep 17 00:00:00 2001 From: erin sims Date: Wed, 1 Jun 2022 10:10:51 +0000 Subject: [PATCH] updated --- hosts | 72 ++++++++++++++++-------------------- playbooks/create_droplet.yml | 10 ++--- playbooks/delete_droplet.yml | 6 +-- playbooks/mpdf.conf.j2 | 21 +++++++++++ playbooks/mpdf.yaml | 6 +++ 5 files changed, 66 insertions(+), 49 deletions(-) create mode 100644 playbooks/mpdf.conf.j2 diff --git a/hosts b/hosts index 31252ca..0d7f181 100644 --- a/hosts +++ b/hosts @@ -2,10 +2,8 @@ athena ansible_host=167.71.188.165 Zeus ansible_host=68.183.50.72 Hades ansible_host=104.131.0.100 Atreyu ansible_host=159.65.178.119 -nyc3-mpdf1 ansible_host=138.197.103.140 -nyc3-mpdf2 ansible_host=165.227.113.33 -nyc3-mpdb1 ansible_host=167.99.48.86 -nyc3-mpdb2 ansible_host=104.248.7.84 +mpdf1 ansible_host=167.99.123.56 +mpdb1 ansible_host=143.198.21.87 [ams1] @@ -28,10 +26,8 @@ athena Zeus Hades Atreyu -nyc3-mpdf1 -nyc3-mpdf2 -nyc3-mpdb1 -nyc3-mpdb2 +mpdf1 +mpdb1 [sfo1] @@ -43,65 +39,59 @@ nyc3-mpdb2 [tor1] -[synapse] -athena - -[prometheus] -athena - -[Git] -Zeus - -[nextcloud] +[Saltmaster] Zeus [mpdb] -nyc3-mpdb1 -nyc3-mpdb2 +mpdb1 [matrix] athena -[salt_minion] -athena -Zeus - -[ansible] +[synapse] athena -Atreyu -nyc3-mpdf1 -nyc3-mpdf2 -nyc3-mpdb1 -nyc3-mpdb2 - -[mpdf] -nyc3-mpdf1 -nyc3-mpdf2 [consul] athena Hades +[prometheus] +athena + +[Git] +Zeus + [www_apache] Zeus -[controller] -Atreyu +[mpdf] +mpdf1 -[Saltmaster] +[salt_minion] +athena Zeus [salt_minon] Hades +[controller] +Atreyu + [alertmanager] athena +[ansible] +athena +Atreyu +mpdf1 +mpdb1 + +[nextcloud] +Zeus + [Thrace_Test] -nyc3-mpdb2 -nyc3-mpdb1 -nyc3-mpdf2 -nyc3-mpdf1 +mpdb1 +mpdf1 Atreyu Hades Zeus diff --git a/playbooks/create_droplet.yml b/playbooks/create_droplet.yml index c2feb30..481509d 100644 --- a/playbooks/create_droplet.yml +++ b/playbooks/create_droplet.yml @@ -5,7 +5,7 @@ vars: mpdf: - 'nyc3-mpdf' - count: 5 + count: 1 mpdb: - 'nyc3-mpdb' tasks: @@ -15,7 +15,7 @@ region: nyc3 image: debian-11-x64 wait_timeout: 100 - name: "mpdb{{ item }}" + name: "mpdf{{ item }}" size_id: s-1vcpu-1gb state: present oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}" @@ -24,7 +24,7 @@ - 'ansible' - 'mpdf' register: created_droplets - loop: "{{ range(1,count+1)|list }}" + loop: "{{ range(1,count| int + 1) }}" - name: create backend droplets digital_ocean_droplet: @@ -32,7 +32,7 @@ region: nyc3 image: debian-11-x64 wait_timeout: 100 - name: "mpdf{{ item }}" + name: "mpdb{{ item }}" size_id: s-1vcpu-1gb state: present oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}" @@ -41,5 +41,5 @@ - 'ansible' - 'mpdb' register: created_droplets - loop: "{{ range(1,count+1)|list }}" + loop: "{{ range(1,count|int + 1) }}" diff --git a/playbooks/delete_droplet.yml b/playbooks/delete_droplet.yml index c7d73f8..5280fba 100644 --- a/playbooks/delete_droplet.yml +++ b/playbooks/delete_droplet.yml @@ -5,7 +5,7 @@ vars: mpdf: - 'nyc3-mpdf' - count: 5 + count: 1 mpdb: - 'nyc3-mpdb' tasks: @@ -24,7 +24,7 @@ - 'ansible' - 'mpdf' register: deleted_droplets - loop: "{{ range(1,count+1)|list }}" + loop: "{{ range(1,count|int + 1) }}" - name: delete backend droplets digital_ocean_droplet: @@ -41,5 +41,5 @@ - 'ansible' - 'mpdb' register: deleted_droplets - loop: "{{ range(1,count+1)|list }}" + loop: "{{ range(1,count|int + 1) }}" diff --git a/playbooks/mpdf.conf.j2 b/playbooks/mpdf.conf.j2 new file mode 100644 index 0000000..0efd142 --- /dev/null +++ b/playbooks/mpdf.conf.j2 @@ -0,0 +1,21 @@ +[Default] +hostname="{{ hostname }}" +name="{{ default }}" +password="{{ password }}" +portnumber="{{ port }}" +useauth=" {{ use_auth }}" +music directory="{{ music_directory }}" +db update time="12345678901" +[] +[Remote] +hostname="{{ server_ip_remote }}" +name="{{ server_name_remote }}" +password="{{ password_remote }}" +portnumber="{{ port_numberi_remote }}" +useauth="{{ use_auth_remote }}" +music directory= "{{ music_directory_remote }}" +db update time="12345678901" +[] + + + diff --git a/playbooks/mpdf.yaml b/playbooks/mpdf.yaml index 4bf2edd..ae46a7c 100644 --- a/playbooks/mpdf.yaml +++ b/playbooks/mpdf.yaml @@ -6,3 +6,9 @@ apt: name: mpd state: present + - name: setup config on hosts + template: + src: mpdf.conf.j2 + dest: /etc/mpd.conf + notify: + - restart mpd