forked from ondra/server-sdk
adding ansible ( to create test database )
This commit is contained in:
parent
8552cc304f
commit
1fc722b751
7
ansible/ansible.cfg
Normal file
7
ansible/ansible.cfg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[defaults]
|
||||||
|
|
||||||
|
# problem with 'create_db' 'Ensure database is created'
|
||||||
|
# @see https://github.com/georchestra/ansible/issues/55
|
||||||
|
# Have to make temorary files readable by all, beacuse when chaning user
|
||||||
|
# -> that use does not have access to temp file ( run scripts )
|
||||||
|
allow_world_readable_tmpfiles=true
|
||||||
7
ansible/ansible.md
Normal file
7
ansible/ansible.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Ansible
|
||||||
|
|
||||||
|
Ansible file taken from: server-tools
|
||||||
|
|
||||||
|
This will instlal `serversdk` test database on `spaceti-experimental`
|
||||||
|
|
||||||
|
`ansible/playbook.sh install-postgres`
|
||||||
8
ansible/install-postgres.yml
Normal file
8
ansible/install-postgres.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
- hosts: db
|
||||||
|
become: yes
|
||||||
|
vars_files:
|
||||||
|
- postgresql/vars.yml
|
||||||
|
vars:
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- geerlingguy.postgresql
|
||||||
10
ansible/inventory.yml
Normal file
10
ansible/inventory.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
db:
|
||||||
|
hosts:
|
||||||
|
spaceti-experimental:
|
||||||
|
ansible_host: 192.168.1.94
|
||||||
|
server_name: 'spaceti-experimental'
|
||||||
|
ansible_user: 'filip'
|
||||||
|
ansible_private_key_file: '~/.ssh/spaceti_gitlab'
|
||||||
|
# ansible_python_interpreter: '/usr/bin/python'
|
||||||
6
ansible/playbook.sh
Executable file
6
ansible/playbook.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
|
||||||
|
cd $SRCDIR
|
||||||
|
ansible-playbook -i inventory.yml $1.yml
|
||||||
19
ansible/postgresql/vars.yml
Normal file
19
ansible/postgresql/vars.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
no_log: no
|
||||||
|
postgresql_databases:
|
||||||
|
- name: serversdk
|
||||||
|
postgresql_users:
|
||||||
|
- name: postgres
|
||||||
|
password: 34rjkciea12
|
||||||
|
postgresql_group: postgres
|
||||||
|
postgresql_global_config_options:
|
||||||
|
- option: listen_addresses
|
||||||
|
value: '*'
|
||||||
|
postgresql_hba_entries:
|
||||||
|
- { type: local, database: all, user: postgres, auth_method: peer }
|
||||||
|
- { type: local, database: all, user: all, auth_method: peer }
|
||||||
|
- { type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5 }
|
||||||
|
- { type: host, database: all, user: all, address: '::1/128', auth_method: md5 }
|
||||||
|
- { type: host, database: all, user: all, address: '0.0.0.0/0', auth_method: md5 } # full access
|
||||||
|
# - { type: host, database: all, user: all, address: '178.209.130.196/32', auth_method: md5 } # access from specific IP only
|
||||||
|
postgresql_restarted_state: "restarted"
|
||||||
Loading…
x
Reference in New Issue
Block a user