Converting molecule tests to v3

This commit is contained in:
Xan Manning 2020-09-26 15:50:03 +01:00
parent 4b4a49bdd5
commit 57f9631265
6 changed files with 14 additions and 17 deletions

View file

@ -46,7 +46,7 @@ env:
install:
# Install test dependencies.
- pip install molecule==2.22 docker jmespath
- pip install molecule[docker] docker jmespath ansible-lint
before_script:
# Use actual Ansible Galaxy role name for the project directory.

View file

@ -1,3 +1,5 @@
---
extends: default
rules:

View file

@ -4,8 +4,10 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
lint: |
set -e
yamllint .
ansible-lint
platforms:
- name: node1
image: "${MOLECULE_DISTRO:-geerlingguy/docker-centos8-ansible:latest}"
@ -38,12 +40,6 @@ provisioner:
name: ansible
options:
verbose: true
lint:
name: ansible-lint
playbooks:
prepare: ${MOLECULE_PREPARE_PLAYBOOK:-prepare.yml}
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
verifier:
name: testinfra
lint:
name: flake8

View file

@ -20,3 +20,4 @@
state: directory
owner: k3suser
group: user
mode: 0700

View file

@ -4,8 +4,10 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
lint: |
set -e
yamllint .
ansible-lint
platforms:
- name: node1
image: "${MOLECULE_DISTRO:-geerlingguy/docker-centos8-ansible:latest}"
@ -53,12 +55,6 @@ provisioner:
name: ansible
options:
verbose: true
lint:
name: ansible-lint
playbooks:
prepare: ${MOLECULE_PREPARE_PLAYBOOK:-prepare.yml}
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
verifier:
name: testinfra
lint:
name: flake8

View file

@ -16,11 +16,13 @@
file:
path: /usr/local/etc/haproxy
state: directory
mode: 0755
- name: Ensure HAProxy is configured
template:
src: haproxy-loadbalancer.conf.j2
dest: /usr/local/etc/haproxy/haproxy.cfg
mode: 0644
- name: Ensure HAProxy service is started
command: haproxy -D -f /usr/local/etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid