Adding Ubuntu support in Ansible - nginx role 77/101477/10
authorJan Benedikt <j.benedikt@partner.samsung.com>
Mon, 10 Feb 2020 15:23:04 +0000 (16:23 +0100)
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>
Thu, 23 Apr 2020 08:08:27 +0000 (08:08 +0000)
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

ansible/roles/nginx/defaults/main.yml
ansible/roles/nginx/molecule/ubuntu/molecule.yml [new file with mode: 0644]

index c2f1e05..1269783 100644 (file)
@@ -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 (file)
index 0000000..9955e7d
--- /dev/null
@@ -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