commit 7c92db12bc734249ab6e96a43aac30e6eefeb970 Author: Dak Thompson Date: Thu Jul 11 16:02:19 2024 -0500 Initial main commit diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..fb0b1b9 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3502a8c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..5dbef31 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1720725158361 + + + + + + \ No newline at end of file diff --git a/homelab_postgres.iml b/homelab_postgres.iml new file mode 100644 index 0000000..9a5cfce --- /dev/null +++ b/homelab_postgres.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/hosts.yml b/hosts.yml new file mode 100644 index 0000000..4b8ff5f --- /dev/null +++ b/hosts.yml @@ -0,0 +1,9 @@ +--- +all: + hosts: + server1: + ansible_become_pass: "{{ server1_become_pass }}" + server2: + ansible_become_pass: "{{ server2_become_pass }}" + vars: + ansible_user: zoe diff --git a/roles/postgresql/tasks/main.yml b/roles/postgresql/tasks/main.yml new file mode 100644 index 0000000..0377c3d --- /dev/null +++ b/roles/postgresql/tasks/main.yml @@ -0,0 +1,31 @@ +--- +- name: Install PostgreSQL + become: yes + zypper: + name: "{{item}}" + state: latest + loop: + - postgresql + - postgresql-server + - postgresql-contrib + - postgresql-devel + - python3-psycopg2 +- name: Turn on Postgres server + become: yes + systemd: + name: postgresql + enabled: yes + state: restarted +- name: Update pg_hba conf + become: yes + postgresql_pg_hba: + contype: local + dest: /var/lib/pgsql/data/pg_hba.conf + method: trust + users: postgres + state: present +- name: Reload postgres + become: yes + systemd: + name: postgresql + state: reloaded diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..71a6c64 --- /dev/null +++ b/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +ansible-playbook -i hosts.yml site.yml --vault-password-file ~/.vault_pass.txt diff --git a/site.yml b/site.yml new file mode 100644 index 0000000..41922fb --- /dev/null +++ b/site.yml @@ -0,0 +1,5 @@ +--- +- name: Setup TeamCity + hosts: server2 + roles: + - role: postgresql