mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Raw refactoring of roles
This commit is contained in:
@@ -3,5 +3,5 @@
|
||||
## Root Access
|
||||
To access the database via the root account execute the following on the server:
|
||||
```bash
|
||||
docker exec -it central-postgres psql -U postgres
|
||||
docker exec -it "{{ applications.postgres.hostname }}" psql -U postgres
|
||||
```
|
@@ -6,7 +6,10 @@ galaxy_info:
|
||||
Manage your data securely and effectively, making it ideal for production or local development.
|
||||
license: "CyMaIS NonCommercial License (CNCL)"
|
||||
license_url: "https://s.veen.world/cncl"
|
||||
company: "Kevin Veen-Birkenbach Consulting & Coaching Solutions"
|
||||
company: |
|
||||
Kevin Veen-Birkenbach
|
||||
Consulting & Coaching Solutions
|
||||
https://www.veen.world
|
||||
min_ansible_version: "2.9"
|
||||
platforms:
|
||||
- name: Docker
|
||||
|
5
roles/docker-postgres/meta/schema.yml
Normal file
5
roles/docker-postgres/meta/schema.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
credentials:
|
||||
postgres_password:
|
||||
description: "Password for the PostgreSQL superuser 'postgres'"
|
||||
algorithm: "bcrypt"
|
||||
validation: "^\\$2[aby]\\$.{56}$"
|
@@ -8,11 +8,11 @@
|
||||
|
||||
- name: Install PostgreSQL
|
||||
docker_container:
|
||||
name: central-postgres
|
||||
name: "{{ applications.postgres.hostname }}"
|
||||
image: "postgres:{{applications.postgres.version}}"
|
||||
detach: yes
|
||||
env:
|
||||
POSTGRES_PASSWORD: "{{ central_postgres_password }}"
|
||||
POSTGRES_PASSWORD: "{{ applications.postgres.credentials.postgres_password }}"
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C" # Necessary for docker-matrix
|
||||
networks:
|
||||
- name: central_postgres
|
||||
@@ -31,7 +31,7 @@
|
||||
when: run_once_docker_postgres is not defined
|
||||
|
||||
- name: Wait for Postgres inside the container
|
||||
shell: docker exec central-postgres pg_isready -U postgres
|
||||
shell: "docker exec {{ applications.postgres.hostname }} pg_isready -U postgres"
|
||||
register: pg_ready
|
||||
until: pg_ready.rc == 0
|
||||
retries: 30
|
||||
@@ -52,7 +52,7 @@
|
||||
name: "{{ database_name }}"
|
||||
state: present
|
||||
login_user: postgres
|
||||
login_password: "{{ central_postgres_password }}"
|
||||
login_password: "{{ applications.postgres.credentials.postgres_password }}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: "{{database_port}}"
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
db: "{{ database_name }}"
|
||||
state: present
|
||||
login_user: postgres
|
||||
login_password: "{{ central_postgres_password }}"
|
||||
login_password: "{{ applications.postgres.credentials.postgres_password }}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: "{{database_port}}"
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
type: table
|
||||
state: present
|
||||
login_user: postgres
|
||||
login_password: "{{ central_postgres_password }}"
|
||||
login_password: "{{ applications.postgres.credentials.postgres_password }}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: "{{database_port}}"
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
type: database
|
||||
state: present
|
||||
login_user: postgres
|
||||
login_password: "{{ central_postgres_password }}"
|
||||
login_password: "{{ applications.postgres.credentials.postgres_password }}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: "{{database_port}}"
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
schema: public
|
||||
state: present
|
||||
login_user: postgres
|
||||
login_password: "{{ central_postgres_password }}"
|
||||
login_password: "{{ applications.postgres.credentials.postgres_password }}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: "{{database_port}}"
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
postgresql_query:
|
||||
db: "{{ database_name }}"
|
||||
login_user: postgres
|
||||
login_password: "{{ central_postgres_password }}"
|
||||
login_password: "{{ applications.postgres.credentials.postgres_password }}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: "{{database_port}}"
|
||||
query: |
|
||||
|
2
roles/docker-postgres/vars/configuration.yml
Normal file
2
roles/docker-postgres/vars/configuration.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
# Please set an version in your inventory file - Rolling release for postgres isn't recommended
|
||||
version: "latest"
|
2
roles/docker-postgres/vars/main.yml
Normal file
2
roles/docker-postgres/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
application_id: postgres
|
||||
hostname: central-postgres
|
Reference in New Issue
Block a user