diff options
-rw-r--r-- | ansible/roles/nginx/defaults/main.yml | 6 | ||||
-rw-r--r-- | ansible/roles/nginx/molecule/ubuntu/molecule.yml | 36 |
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 |