summaryrefslogtreecommitdiffstats
path: root/ansible/roles/package-repository-check/molecule/default
diff options
context:
space:
mode:
authorJan Benedikt <j.benedikt@partner.samsung.com>2020-05-05 08:46:19 +0200
committerJan Benedikt <j.benedikt@partner.samsung.com>2020-05-14 09:28:34 +0200
commite56bd4f45f5d9f68aeb406510cf4aa5741405d80 (patch)
tree9436bb14f10ba9e9f480dc73e8921895aa4093ca /ansible/roles/package-repository-check/molecule/default
parent56af1f9d2c3e2d0b6529d71014d619619cf25933 (diff)
Fix lint errors in package-repository-check role
In package-repository-check was changed command module to service module due to lint failing. Failing was caused by errors: [301] Commands should not change things if nothing needs doing [303] service used in place of service module Added molecule test. Issue-ID: OOM-2395 Signed-off-by: Jan Benedikt <j.benedikt@partner.samsung.com> Change-Id: I6cfdfe920eabfb9a0c43cc9ba4ffcd81df1d6852
Diffstat (limited to 'ansible/roles/package-repository-check/molecule/default')
-rwxr-xr-xansible/roles/package-repository-check/molecule/default/molecule.yml58
-rwxr-xr-xansible/roles/package-repository-check/molecule/default/playbook.yml5
2 files changed, 63 insertions, 0 deletions
diff --git a/ansible/roles/package-repository-check/molecule/default/molecule.yml b/ansible/roles/package-repository-check/molecule/default/molecule.yml
new file mode 100755
index 00000000..27003dcb
--- /dev/null
+++ b/ansible/roles/package-repository-check/molecule/default/molecule.yml
@@ -0,0 +1,58 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: infra_host
+ image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
+ pre_build_image: True
+ privileged: true
+ volume_mounts:
+ - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
+ override_command: False
+ groups:
+ - infrastructure
+ - name: node0
+ image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
+ pre_build_image: True
+ privileged: true
+ volume_mounts:
+ - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
+ override_command: False
+ groups:
+ - kubernetes
+provisioner:
+ name: ansible
+ lint:
+ name: ansible-lint
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+scenario:
+ name: default
+ test_sequence:
+ - lint
+ - cleanup
+ - destroy
+ - dependency
+ - syntax
+ - create
+ - prepare
+ - converge
+ # - idempotence
+ # --> Action: 'idempotence'
+ # ERROR: Idempotence test failed because of the following tasks:
+ # * [infra_host] => package-repository-check : Clean yum cache
+ # * [node0] => package-repository-check : Clean yum cache
+ - side_effect
+ - verify
+ - cleanup
+ - destroy
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
+ options:
+ v: 1
diff --git a/ansible/roles/package-repository-check/molecule/default/playbook.yml b/ansible/roles/package-repository-check/molecule/default/playbook.yml
new file mode 100755
index 00000000..7dd80c77
--- /dev/null
+++ b/ansible/roles/package-repository-check/molecule/default/playbook.yml
@@ -0,0 +1,5 @@
+---
+- name: Activate repository on node host
+ hosts: all
+ roles:
+ - package-repository-check