Update molecule configuration to work with 3.0.
This commit is contained in:
parent
e9189c16a8
commit
625469d0b5
|
@ -15,7 +15,7 @@ env:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# Install test dependencies.
|
# Install test dependencies.
|
||||||
- pip install molecule docker
|
- pip install molecule yamllint ansible-lint docker
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# Use actual Ansible Galaxy role name for the project directory.
|
# Use actual Ansible Galaxy role name for the project directory.
|
||||||
|
|
|
@ -4,9 +4,8 @@ dependency:
|
||||||
driver:
|
driver:
|
||||||
name: docker
|
name: docker
|
||||||
lint:
|
lint:
|
||||||
name: yamllint
|
yamllint .
|
||||||
options:
|
ansible-lint
|
||||||
config-file: molecule/default/yaml-lint.yml
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: instance
|
- name: instance
|
||||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
||||||
|
@ -17,13 +16,7 @@ platforms:
|
||||||
pre_build_image: true
|
pre_build_image: true
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
playbooks:
|
playbooks:
|
||||||
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
|
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
||||||
scenario:
|
scenario:
|
||||||
name: default
|
name: default
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
|
|
||||||
vars:
|
|
||||||
postgresql_databases:
|
|
||||||
- name: example
|
|
||||||
postgresql_users:
|
|
||||||
- name: jdoe
|
|
||||||
|
|
||||||
pre_tasks:
|
|
||||||
# The Fedora 30+ container images have only C.UTF-8 installed
|
|
||||||
- name: Set database locale if using Fedora 30+
|
|
||||||
set_fact:
|
|
||||||
postgresql_databases:
|
|
||||||
- name: example
|
|
||||||
lc_collate: 'C.UTF-8'
|
|
||||||
lc_ctype: 'C.UTF-8'
|
|
||||||
when:
|
|
||||||
- ansible_distribution == 'Fedora'
|
|
||||||
- ansible_distribution_major_version >= '30'
|
|
||||||
|
|
||||||
- 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
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
extends: default
|
|
||||||
rules:
|
|
||||||
line-length:
|
|
||||||
max: 120
|
|
||||||
level: warning
|
|
Loading…
Reference in New Issue