summaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
authorSamuli Silvius <s.silvius@partner.samsung.com>2019-06-07 13:35:38 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-07 13:35:38 +0000
commit3ef63f580a6fcf697c4f28ca55f27239f564dc53 (patch)
tree0a282543c62f3c8f14b8da9055110f3a2b61cd23 /ansible/roles
parent07c27d8fda62647e3a37297d8000394c3435cc5c (diff)
parentdbc585572785f76814379b1abedaa6ea6d433653 (diff)
Merge "Add role level tests for 'nginx' role"
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/nginx/.yamllint11
-rw-r--r--ansible/roles/nginx/defaults/main.yml2
-rw-r--r--ansible/roles/nginx/molecule/default/molecule.yml30
-rw-r--r--ansible/roles/nginx/molecule/default/playbook.yml5
-rw-r--r--ansible/roles/nginx/molecule/default/prepare.yml8
5 files changed, 55 insertions, 1 deletions
diff --git a/ansible/roles/nginx/.yamllint b/ansible/roles/nginx/.yamllint
new file mode 100644
index 00000000..ad0be760
--- /dev/null
+++ b/ansible/roles/nginx/.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/nginx/defaults/main.yml b/ansible/roles/nginx/defaults/main.yml
index 260de9bf..8bf44197 100644
--- a/ansible/roles/nginx/defaults/main.yml
+++ b/ansible/roles/nginx/defaults/main.yml
@@ -4,7 +4,7 @@ simulated_hosts:
http:
nexus:
all_simulated_hosts:
- "{{ simulated_hosts.git + simulated_hosts.http + simulated_hosts.nexus }}"
+ "{{ simulated_hosts.git + simulated_hosts.http + simulated_hosts.nexus }}"
nginx:
ports:
diff --git a/ansible/roles/nginx/molecule/default/molecule.yml b/ansible/roles/nginx/molecule/default/molecule.yml
new file mode 100644
index 00000000..63c47724
--- /dev/null
+++ b/ansible/roles/nginx/molecule/default/molecule.yml
@@ -0,0 +1,30 @@
+---
+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
+ volumes:
+ - /var/lib/docker
+ groups:
+ - infrastructure
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ inventory:
+ links:
+ group_vars: ../../../../group_vars
+ lint:
+ name: ansible-lint
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
diff --git a/ansible/roles/nginx/molecule/default/playbook.yml b/ansible/roles/nginx/molecule/default/playbook.yml
new file mode 100644
index 00000000..431bb666
--- /dev/null
+++ b/ansible/roles/nginx/molecule/default/playbook.yml
@@ -0,0 +1,5 @@
+---
+- name: Converge
+ hosts: all
+ roles:
+ - nginx
diff --git a/ansible/roles/nginx/molecule/default/prepare.yml b/ansible/roles/nginx/molecule/default/prepare.yml
new file mode 100644
index 00000000..5c6ff5d8
--- /dev/null
+++ b/ansible/roles/nginx/molecule/default/prepare.yml
@@ -0,0 +1,8 @@
+---
+- name: Prepare
+ hosts: all
+ vars_files:
+ - ../../../../roles/nginx/defaults/main.yml
+ roles:
+ - prepare-docker-dind
+ - prepare-nginx