summaryrefslogtreecommitdiffstats
path: root/ansible/roles/nginx
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-06-05 13:53:22 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-06-05 14:11:28 +0200
commitdbc585572785f76814379b1abedaa6ea6d433653 (patch)
tree694b2be540cb58a690ce7e4519beb84d0f9fde97 /ansible/roles/nginx
parentd3cb6429d6d3cdcd625906e702140a51fc146847 (diff)
Add role level tests for 'nginx' role
Introduce full role level test coverage for 'nginx' role. Change-Id: I7c634775433a2336e43cdfc73d4698d5e2933f0e Issue-ID: OOM-1913 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/roles/nginx')
-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