Skip to content

Commit

Permalink
Problem: ansible-pulp CI is failing as of molecule 3.0's release
Browse files Browse the repository at this point in the history
Solution:

Follow molecule 3.0 migration guide:
ansible/molecule#2560

Implementation includes:
1. Installing ansible-lint and molecule-inspec explicitly.
2. Reworking lint sections of molecule.yml files
3. Renaming playbook.yml symlinks to converge.yml

Fixes: #6211
  • Loading branch information
mikedep333 committed Feb 20, 2020
1 parent ecc1a0f commit 6099026
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 50 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ and so on.

**Using Molecule:**

1. Install [molecule](https://molecule.readthedocs.io/en/latest/). It is recommended that you do so
with `pip` in a virtualenv.
1. Install [molecule](https://molecule.readthedocs.io/en/latest/)
[molecule-inspec](https://github.com/ansible-community/molecule-inspec),
and [ansible-lint](https://docs.ansible.com/ansible-lint/).

It is recommended that you do so with `pip` in a virtualenv.
2. Run molecule commands.

Test all scenarios on all hosts.
Expand Down
File renamed without changes.
12 changes: 4 additions & 8 deletions molecule/default-upgrade/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ dependency:
role-file: requirements.yml
driver:
name: docker
lint:
name: yamllint
lint: |
yamllint
ansible-lint
# rubocop
# This is ignored by molecule, but can be reused in yaml
.platform_base: &platform_base
privileged: False
Expand Down Expand Up @@ -40,10 +42,7 @@ provisioner:
inventory:
links:
host_vars: ../scenario_resources/host_vars/
lint:
name: ansible-lint
scenario:
name: default-upgrade
test_sequence:
- lint
- dependency
Expand All @@ -56,6 +55,3 @@ scenario:
- verify
verifier:
name: inspec
lint:
name: rubocop
enabled: false
File renamed without changes.
12 changes: 4 additions & 8 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ dependency:
role-file: requirements.yml
driver:
name: docker
lint:
name: yamllint
lint: |
yamllint
ansible-lint
# rubocop
# This is ignored by molecule, but can be reused in yaml
.platform_base: &platform_base
privileged: False
Expand Down Expand Up @@ -37,10 +39,7 @@ provisioner:
links:
host_vars: ../scenario_resources/host_vars/
group_vars: ../scenario_resources/group_vars/
lint:
name: ansible-lint
scenario:
name: default
test_sequence:
- lint
- dependency
Expand All @@ -53,6 +52,3 @@ scenario:
- verify
verifier:
name: inspec
lint:
name: rubocop
enabled: false
File renamed without changes.
12 changes: 4 additions & 8 deletions molecule/dynamic/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ dependency:
role-file: requirements.yml
driver:
name: docker
lint:
name: yamllint
lint: |
yamllint
ansible-lint
# rubocop
# This is ignored by molecule, but can be reused in yaml
.platform_base: &platform_base
privileged: False
Expand Down Expand Up @@ -37,10 +39,7 @@ provisioner:
links:
host_vars: ../scenario_resources/host_vars/
group_vars: ../scenario_resources/group_vars/
lint:
name: ansible-lint
scenario:
name: dynamic
test_sequence:
- lint
- dependency
Expand All @@ -53,6 +52,3 @@ scenario:
- verify
verifier:
name: inspec
lint:
name: rubocop
enabled: false
File renamed without changes.
12 changes: 4 additions & 8 deletions molecule/source-dynamic/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ dependency:
role-file: requirements.yml
driver:
name: docker
lint:
name: yamllint
lint: |
yamllint
ansible-lint
# rubocop
# This is ignored by molecule, but can be reused in yaml
.platform_base: &platform_base
privileged: False
Expand Down Expand Up @@ -33,10 +35,7 @@ provisioner:
links:
host_vars: ../scenario_resources/host_vars/
group_vars: ../scenario_resources/group_vars/
lint:
name: ansible-lint
scenario:
name: source-dynamic
test_sequence:
- lint
- dependency
Expand All @@ -52,6 +51,3 @@ scenario:

verifier:
name: inspec
lint:
name: rubocop
enabled: false
File renamed without changes.
12 changes: 4 additions & 8 deletions molecule/source-upgrade/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ dependency:
role-file: requirements.yml
driver:
name: docker
lint:
name: yamllint
lint: |
yamllint
ansible-lint
# rubocop
# This is ignored by molecule, but can be reused in yaml
.platform_base: &platform_base
privileged: False
Expand Down Expand Up @@ -35,10 +37,7 @@ provisioner:
inventory:
links:
host_vars: ../scenario_resources/host_vars/
lint:
name: ansible-lint
scenario:
name: source-upgrade
test_sequence:
- lint
- dependency
Expand All @@ -57,6 +56,3 @@ scenario:
prepare: prepare.yml
verifier:
name: inspec
lint:
name: rubocop
enabled: false
File renamed without changes.
12 changes: 4 additions & 8 deletions molecule/source/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ dependency:
role-file: requirements.yml
driver:
name: docker
lint:
name: yamllint
lint: |
yamllint
ansible-lint
# rubocop
# This is ignored by molecule, but can be reused in yaml
.platform_base: &platform_base
privileged: False
Expand Down Expand Up @@ -33,10 +35,7 @@ provisioner:
links:
host_vars: ../scenario_resources/host_vars/
group_vars: ../scenario_resources/group_vars/
lint:
name: ansible-lint
scenario:
name: source
test_sequence:
- lint
- dependency
Expand All @@ -52,6 +51,3 @@ scenario:

verifier:
name: inspec
lint:
name: rubocop
enabled: false
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ skipsdist = true
sitepackages = true
deps =
ansible
ansible-lint
docker
molecule
molecule-inspec
passenv = TRAVIS_WAIT
whitelist_externals =
travis-wait-enhanced
Expand Down

0 comments on commit 6099026

Please sign in to comment.