Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mariancraciun1983 committed Nov 16, 2020
0 parents commit f97bbee
Show file tree
Hide file tree
Showing 65 changed files with 5,939 additions and 0 deletions.
Empty file added .ansible-lint
Empty file.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inventory
*.retry
*.log
vars.yml
._*
*.py[co]
.python-version
files/hetzner/hetzner_failover.conf
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
language: python
services: docker

python:
- "3.8"

cache:
- pip:
- directories:
- /home/travis/.cache/pipenv

branches:
only:
- master
- develop

before_install:
- python --version


install:
- pip3 install pipenv
- pipenv install

script:
- pipenv run python -V
- pipenv run molecule --version
- pipenv run molecule test -s default

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
33 changes: 33 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# Based on ansible-lint config
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Marian C <me@marian.dev>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
ansible = "==2.9.15"
ansible-lint = "==4.3.7"
yamllint = "==1.25.0"
molecule = "==3.2.0a0"
molecule-docker = "==0.3.3"

[requires]
python_version = "3.8"


[pipenv]
allow_prereleases = true
545 changes: 545 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
postgres_role:
postgres_repmgr_node_id:

_postgres_master_envvars: "{{ hostvars | filter_first_hostvars('postgres_role','master') }}"

postgres_use_internal_ip: false

postgres_master_ip: "{% if postgres_use_internal_ip|bool %}{{ _postgres_master_envvars['internal_ip'] }}{% else %}{{ _postgres_master_envvars['ansible_default_ipv4']['address'] }}{% endif %}"
postgres_master_name: "{{ _postgres_master_envvars['ansible_hostname'] }}"
postgres_master_node_id: "{{ _postgres_master_envvars['postgres_repmgr_node_id'] }}"

postgres_listen_ip: "{% if postgres_use_internal_ip|bool %}{{ internal_ip }}{% else %}{{ ansible_default_ipv4.address }}{% endif %}"

postgres_version: 13

postgres_config_directory: "/etc/postgresql/{{ postgres_version }}/main"
postgres_data_directory: "/var/lib/postgresql/{{ postgres_version }}/main"
postgres_bin_directory: "/usr/lib/postgresql/{{ postgres_version }}/bin"

# do we want to cleanup the master data?
postgres_master_cleanup: false
postgres_slave_cleanup: false
postgres_check_replication: false

postgres_admin_user:
db: admin
name: admin
pass: admin1q2w3e

postgres_repl_user:
name: repl
pass: repl1q2w3e

## Repmg

postgres_repmgr_enabled: false
postgres_repmgr_user:
name: repmgr
pass: repmgr1q2w3e
db: repmgr

postgres_repmgr_pacemaker: false
postgres_repmgr_pacemaker_reset: false
postgres_repmgr_pacemaker_helpers_init: false


postgres_repmgr_pcs: false
postgres_repmgr_pcs_cleanup: false

# postgres_ha_ip_internal:

# used to automatically rejoin one of the failed masters
postgres_repmgr_failover_host:
Loading

0 comments on commit f97bbee

Please sign in to comment.