summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Savineau <dsavinea@redhat.com>2019-02-12 11:28:45 -0500
committerDimitri Savineau <dsavinea@redhat.com>2019-02-12 11:28:45 -0500
commit74eedd7a7bc8827841a4e4b5cd05b9f38e71ee52 (patch)
tree11b7a95b08bc3673aa062c33a48487910a13a827
parent122c88db7d1cc57dc0409fa7179e7493bf6a31cd (diff)
Add molecule configuration
At this time converge, idempotence and verify aren't executed due to the dependency on a TripleO environment and the RHSM. Change-Id: Ifa6aa778a3952f5cb054fed309e858fbd4bc21d1
-rw-r--r--.gitignore1
-rw-r--r--.yamllint10
-rw-r--r--molecule/default/Dockerfile.j212
-rw-r--r--molecule/default/molecule.yml34
-rw-r--r--molecule/default/playbook.yml6
-rw-r--r--tox.ini19
6 files changed, 82 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..172bf57
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.tox
diff --git a/.yamllint b/.yamllint
new file mode 100644
index 0000000..a4d53d6
--- /dev/null
+++ b/.yamllint
@@ -0,0 +1,10 @@
+extends: default
+
+rules:
+ braces:
+ max-spaces-inside: 1
+ level: error
+ brackets:
+ max-spaces-inside: 1
+ level: error
+ line-length: disable
diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2
new file mode 100644
index 0000000..0529528
--- /dev/null
+++ b/molecule/default/Dockerfile.j2
@@ -0,0 +1,12 @@
+{% if item.registry is defined %}
+FROM {{ item.registry.url }}/{{ item.image }}
+{% else %}
+FROM {{ item.image }}
+{% endif %}
+
+RUN yum install -y sudo && \
+ yum clean all
+
+RUN adduser centos && \
+ echo 'centos ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/90-centos && \
+ chmod 440 /etc/sudoers.d/90-centos
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
new file mode 100644
index 0000000..417e623
--- /dev/null
+++ b/molecule/default/molecule.yml
@@ -0,0 +1,34 @@
+---
+dependency:
+ name: galaxy
+ enabled: false
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: el7
+ image: centos:latest
+ command: /sbin/init
+ capabilities:
+ - SYS_ADMIN
+provisioner:
+ name: ansible
+ connection_options:
+ ansible_user: centos
+ lint:
+ name: ansible-lint
+scenario:
+ name: default
+ test_sequence:
+ - lint
+ - destroy
+ - dependency
+ - syntax
+ - create
+ - prepare
+ - destroy
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml
new file mode 100644
index 0000000..e9f1bd7
--- /dev/null
+++ b/molecule/default/playbook.yml
@@ -0,0 +1,6 @@
+---
+- name: Converge
+ hosts: all
+ tasks:
+ - import_role:
+ name: ansible-role-openstack-certification
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..c02fb74
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,19 @@
+[tox]
+minversion = 1.8
+envlist = py{27,36}
+skipsdist = true
+
+[testenv]
+passenv = *
+deps =
+ ansible>=2.7,<2.8
+ docker
+ molecule
+
+[testenv:py27]
+commands =
+ molecule test
+
+[testenv:py36]
+commands =
+ molecule test