add roles
This commit is contained in:
parent
f234c3b08f
commit
b8296f4bee
56 changed files with 1157 additions and 4 deletions
29
roles/geerlingguy.postgresql/molecule/default/molecule.yml
Normal file
29
roles/geerlingguy.postgresql/molecule/default/molecule.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
lint:
|
||||
name: yamllint
|
||||
options:
|
||||
config-file: molecule/default/yaml-lint.yml
|
||||
platforms:
|
||||
- name: instance
|
||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
lint:
|
||||
name: ansible-lint
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
|
||||
scenario:
|
||||
name: default
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
name: flake8
|
||||
35
roles/geerlingguy.postgresql/molecule/default/playbook.yml
Normal file
35
roles/geerlingguy.postgresql/molecule/default/playbook.yml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
postgresql_databases:
|
||||
- name: example
|
||||
postgresql_users:
|
||||
- name: jdoe
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=true cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Set custom variables for old CentOS 6 PostgreSQL install.
|
||||
set_fact:
|
||||
postgresql_hba_entries: []
|
||||
postgresql_global_config_options:
|
||||
- option: unix_socket_directory
|
||||
value: '{{ postgresql_unix_socket_directories[0] }}'
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- ansible_distribution_version.split('.')[0] == '6'
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.postgresql
|
||||
|
||||
post_tasks:
|
||||
- name: Verify postgres is running.
|
||||
command: "{{ postgresql_bin_path }}/pg_ctl -D {{ postgresql_data_dir }} status"
|
||||
changed_when: false
|
||||
become: true
|
||||
become_user: postgres
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
extends: default
|
||||
rules:
|
||||
line-length:
|
||||
max: 120
|
||||
level: warning
|
||||
Loading…
Add table
Add a link
Reference in a new issue