[MOLECULE 3.3.0] Upgrade linters Molecule setup
In 3.x.x version family of Molecule the syntax for linters
invocation has been changed.
Ref.: https://molecule.readthedocs.io/en/latest/configuration.html#lint
Change-Id: I82d1fd996eb5853953ea6bc74dcbb88a485a2084
Issue-ID: OOM-2722
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
diff --git a/ansible/roles/docker/.yamllint b/ansible/roles/docker/.yamllint
index e8e79a5..41fc03d 100644
--- a/ansible/roles/docker/.yamllint
+++ b/ansible/roles/docker/.yamllint
@@ -1,3 +1,4 @@
+---
extends: default
rules:
diff --git a/ansible/roles/docker/molecule/default/molecule.yml b/ansible/roles/docker/molecule/default/molecule.yml
index efa7f0a..031aa5f 100644
--- a/ansible/roles/docker/molecule/default/molecule.yml
+++ b/ansible/roles/docker/molecule/default/molecule.yml
@@ -3,8 +3,11 @@
name: galaxy
driver:
name: docker
-lint:
- name: yamllint
+lint: |
+ set -e
+ yamllint .
+ ansible-lint .
+ flake8
platforms:
- name: infrastructure-server
image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
@@ -20,8 +23,6 @@
- /var/lib/docker
provisioner:
name: ansible
- lint:
- name: ansible-lint
env:
ANSIBLE_ROLES_PATH: ../../../../test/roles
ANSIBLE_LIBRARY: ../../../../library
@@ -35,7 +36,5 @@
name: testinfra
options:
verbose: true
- lint:
- name: flake8
options:
ignore: W291 # trailing whitespace
diff --git a/ansible/roles/docker/molecule/ubuntu/molecule.yml b/ansible/roles/docker/molecule/ubuntu/molecule.yml
index 8325ffb..751782a 100644
--- a/ansible/roles/docker/molecule/ubuntu/molecule.yml
+++ b/ansible/roles/docker/molecule/ubuntu/molecule.yml
@@ -3,8 +3,11 @@
name: galaxy
driver:
name: docker
-lint:
- name: yamllint
+lint: |
+ set -e
+ yamllint .
+ ansible-lint .
+ flake8
platforms:
- name: infrastructure-server
image: molecule-${PREBUILD_PLATFORM_DISTRO:-ubuntu}:${PREBUILD_DISTRO_VERSION:-18.04}
@@ -20,8 +23,6 @@
- /var/lib/docker
provisioner:
name: ansible
- lint:
- name: ansible-lint
playbooks:
prepare: ../default/prepare.yml
converge: ../default/playbook.yml
@@ -39,8 +40,6 @@
name: testinfra
options:
verbose: true
- lint:
- name: flake8
options:
ignore: W291 # trailing whitespace
directory: ../default/tests/