summaryrefslogtreecommitdiffstats
path: root/ansible/roles/chartmuseum/molecule/default
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/chartmuseum/molecule/default')
-rw-r--r--ansible/roles/chartmuseum/molecule/default/molecule.yml33
-rw-r--r--ansible/roles/chartmuseum/molecule/default/playbook.yml5
-rw-r--r--ansible/roles/chartmuseum/molecule/default/prepare.yml8
-rw-r--r--ansible/roles/chartmuseum/molecule/default/tests/test_default.py14
4 files changed, 60 insertions, 0 deletions
diff --git a/ansible/roles/chartmuseum/molecule/default/molecule.yml b/ansible/roles/chartmuseum/molecule/default/molecule.yml
new file mode 100644
index 00000000..9c5d1c2a
--- /dev/null
+++ b/ansible/roles/chartmuseum/molecule/default/molecule.yml
@@ -0,0 +1,33 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: instance-chartmuseum
+ image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
+ pre_build_image: True
+ privileged: true
+ override_command: False
+ volumes:
+ - /var/lib/docker
+ groups:
+ - infrastructure
+provisioner:
+ name: ansible
+ lint:
+ name: ansible-lint
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ ANSIBLE_LIBRARY: ../../../../library
+ inventory:
+ links:
+ group_vars: ../../../../group_vars
+scenario:
+ name: default
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
diff --git a/ansible/roles/chartmuseum/molecule/default/playbook.yml b/ansible/roles/chartmuseum/molecule/default/playbook.yml
new file mode 100644
index 00000000..2694582a
--- /dev/null
+++ b/ansible/roles/chartmuseum/molecule/default/playbook.yml
@@ -0,0 +1,5 @@
+---
+- name: Converge
+ hosts: all
+ roles:
+ - chartmuseum
diff --git a/ansible/roles/chartmuseum/molecule/default/prepare.yml b/ansible/roles/chartmuseum/molecule/default/prepare.yml
new file mode 100644
index 00000000..dee6a976
--- /dev/null
+++ b/ansible/roles/chartmuseum/molecule/default/prepare.yml
@@ -0,0 +1,8 @@
+---
+- name: Prepare infra
+ hosts: infrastructure
+ vars_files:
+ - ../../../../roles/chartmuseum/defaults/main.yml
+ roles:
+ - prepare-docker-dind
+ - prepare-chartmuseum
diff --git a/ansible/roles/chartmuseum/molecule/default/tests/test_default.py b/ansible/roles/chartmuseum/molecule/default/tests/test_default.py
new file mode 100644
index 00000000..40773065
--- /dev/null
+++ b/ansible/roles/chartmuseum/molecule/default/tests/test_default.py
@@ -0,0 +1,14 @@
+import os
+
+import testinfra.utils.ansible_runner
+
+testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
+ os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
+
+
+def test_chartmuseum_dir(host):
+ assert host.file("/chartmuseum").is_directory
+
+
+def test_container_running(host):
+ assert host.docker('chartmuseum').is_running