summaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
authorJan Benedikt <j.benedikt@partner.samsung.com>2020-02-10 16:23:04 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-04-23 08:08:27 +0000
commite23ab1061b2ad64c8cd5c5d53d6ceb0da5e0baa2 (patch)
tree298c24ecd3d99820679dae996c10ee3147b8df6c /ansible/roles
parent8013a2420fff9059cc67ccae22a1abeea4e26542 (diff)
Adding Ubuntu support in Ansible - nginx role
Extending ansible playbooks of ubuntu support. Creating new test with Ubuntu image for Molecule in nginx role. Issue-ID: OOM-1671 Signed-off-by: Jan Benedikt <j.benedikt@partner.samsung.com> Change-Id: I5f6a5aedfd9a2e17d3b1bb711d3e85a242b5e2d5
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/nginx/defaults/main.yml6
-rw-r--r--ansible/roles/nginx/molecule/ubuntu/molecule.yml36
2 files changed, 40 insertions, 2 deletions
diff --git a/ansible/roles/nginx/defaults/main.yml b/ansible/roles/nginx/defaults/main.yml
index c2f1e05c..1269783d 100644
--- a/ansible/roles/nginx/defaults/main.yml
+++ b/ansible/roles/nginx/defaults/main.yml
@@ -5,7 +5,9 @@ simulated_hosts:
nexus:
all_simulated_hosts:
"{{ simulated_hosts.git + simulated_hosts.http + simulated_hosts.nexus }}"
-
+package_type:
+ RedHat: rpm
+ Debian: deb
nginx:
ports:
- "80:80"
@@ -16,7 +18,7 @@ nginx:
- "{{ app_data_path }}/certs:/etc/nginx/certs:ro"
- "{{ app_data_path }}/git-repo:/srv/git:rw"
- "{{ app_data_path }}/http:/srv/http:rw"
- - "{{ app_data_path }}/pkg/rpm:/srv/http/repo.infra-server/rpm:rw"
+ - "{{ app_data_path }}/pkg/{{ package_type[ansible_os_family] }}:/srv/http/repo.infra-server/{{ package_type[ansible_os_family] }}:rw"
- "{{ app_data_path }}/pkg/ubuntu/xenial:/srv/http/repo.infra-server/ubuntu/xenial:rw"
- /var/log/nginx:/var/log/nginx:rw
# Default rule for tarball naming translation
diff --git a/ansible/roles/nginx/molecule/ubuntu/molecule.yml b/ansible/roles/nginx/molecule/ubuntu/molecule.yml
new file mode 100644
index 00000000..9955e7d5
--- /dev/null
+++ b/ansible/roles/nginx/molecule/ubuntu/molecule.yml
@@ -0,0 +1,36 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: infrastructure-server
+ image: molecule-${PREBUILD_PLATFORM_DISTRO:-ubuntu}:${PREBUILD_DISTRO_VERSION:-18.04}
+ 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
+ playbooks:
+ prepare: ../default/prepare.yml
+ converge: ../default/playbook.yml
+ cleanup: ../default/cleanup.yml
+scenario:
+ name: ubuntu
+verifier:
+ name: testinfra
+ lint:
+ name: flake8