summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-05-10 12:33:59 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-05-30 13:50:11 +0200
commit4b8c98fc46f0462322b01b349324a0bfc3de0258 (patch)
tree10b12d1db4c62bb632556c29978ab7b8f10a3a7b /ansible
parent7e5ddf0b3e0f23bf499b3311340253485d06fc33 (diff)
Add Molecule tests for 'dns' role
This commit supplements 'Molecule test for infrastructure playbook' with role level tests. Change-Id: I14cdeedf1c80c0ee06bacf0a391ee1d7ccd6df55 Issue-ID: OOM-1841 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/dns/.yamllint11
l---------ansible/roles/dns/molecule/default/group_vars1
-rw-r--r--ansible/roles/dns/molecule/default/molecule.yml36
-rw-r--r--ansible/roles/dns/molecule/default/playbook.yml5
-rw-r--r--ansible/roles/dns/molecule/default/prepare.yml10
-rw-r--r--ansible/test/play-infrastructure/molecule/default/molecule.yml2
l---------ansible/test/roles/prepare-dns/defaults1
7 files changed, 64 insertions, 2 deletions
diff --git a/ansible/roles/dns/.yamllint b/ansible/roles/dns/.yamllint
new file mode 100644
index 00000000..ad0be760
--- /dev/null
+++ b/ansible/roles/dns/.yamllint
@@ -0,0 +1,11 @@
+extends: default
+
+rules:
+ braces:
+ max-spaces-inside: 1
+ level: error
+ brackets:
+ max-spaces-inside: 1
+ level: error
+ line-length: disable
+ truthy: disable
diff --git a/ansible/roles/dns/molecule/default/group_vars b/ansible/roles/dns/molecule/default/group_vars
new file mode 120000
index 00000000..e04e088f
--- /dev/null
+++ b/ansible/roles/dns/molecule/default/group_vars
@@ -0,0 +1 @@
+../../../../group_vars/ \ No newline at end of file
diff --git a/ansible/roles/dns/molecule/default/molecule.yml b/ansible/roles/dns/molecule/default/molecule.yml
new file mode 100644
index 00000000..00c63ca9
--- /dev/null
+++ b/ansible/roles/dns/molecule/default/molecule.yml
@@ -0,0 +1,36 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: infrastructure-server
+ image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
+ pre_build_image: True
+ privileged: true
+ override_command: False
+ groups:
+ - infrastructure
+ volumes:
+ - /var/lib/docker
+provisioner:
+ name: ansible
+ lint:
+ name: ansible-lint
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ ANSIBLE_LIBRARY: ../../../../library
+ inventory:
+ host_vars:
+ infrastructure-server:
+ cluster_ip: 127.0.0.1
+ group_vars:
+ all:
+ app_name: onap
+ app_data_path: "/opt/{{ app_name }}"
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
diff --git a/ansible/roles/dns/molecule/default/playbook.yml b/ansible/roles/dns/molecule/default/playbook.yml
new file mode 100644
index 00000000..8754f8b0
--- /dev/null
+++ b/ansible/roles/dns/molecule/default/playbook.yml
@@ -0,0 +1,5 @@
+---
+- name: Converge
+ hosts: all
+ roles:
+ - role: dns
diff --git a/ansible/roles/dns/molecule/default/prepare.yml b/ansible/roles/dns/molecule/default/prepare.yml
new file mode 100644
index 00000000..f29f089e
--- /dev/null
+++ b/ansible/roles/dns/molecule/default/prepare.yml
@@ -0,0 +1,10 @@
+---
+- name: Get localhost facts
+ hosts: localhost
+
+- name: Setup all hosts for playing dns role
+ hosts: all
+ roles:
+ - prepare-common
+ - prepare-docker-dind
+ - prepare-dns
diff --git a/ansible/test/play-infrastructure/molecule/default/molecule.yml b/ansible/test/play-infrastructure/molecule/default/molecule.yml
index 894ab804..c4b7901a 100644
--- a/ansible/test/play-infrastructure/molecule/default/molecule.yml
+++ b/ansible/test/play-infrastructure/molecule/default/molecule.yml
@@ -27,8 +27,6 @@ platforms:
privileged: true
override_command: false
restart_policy: unless-stopped
- env:
- container: docker
volumes:
- /var/lib/docker
groups:
diff --git a/ansible/test/roles/prepare-dns/defaults b/ansible/test/roles/prepare-dns/defaults
new file mode 120000
index 00000000..aad47092
--- /dev/null
+++ b/ansible/test/roles/prepare-dns/defaults
@@ -0,0 +1 @@
+../../../roles/dns/defaults \ No newline at end of file