diff options
author | Michal Ptacek <m.ptacek@partner.samsung.com> | 2019-03-06 09:12:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-06 09:12:06 +0000 |
commit | 181b1232625050a7e913f4f8b9200e59273e541d (patch) | |
tree | fdce35fa67291672cc981c1a4f7f05660e9317d3 /ansible/roles/nginx | |
parent | ffca2e27b39c7ebf3daf34367457365266ed53ab (diff) | |
parent | 427850b55cb858549582bfc9c8737d3a3bcf55b2 (diff) |
Merge "Improve nginx role testability"
Diffstat (limited to 'ansible/roles/nginx')
-rw-r--r-- | ansible/roles/nginx/defaults/main.yml | 21 | ||||
-rw-r--r-- | ansible/roles/nginx/tasks/main.yml | 19 |
2 files changed, 28 insertions, 12 deletions
diff --git a/ansible/roles/nginx/defaults/main.yml b/ansible/roles/nginx/defaults/main.yml new file mode 100644 index 00000000..7c9fa0be --- /dev/null +++ b/ansible/roles/nginx/defaults/main.yml @@ -0,0 +1,21 @@ +--- +simulated_hosts: + git: + http: + nexus: +all_simulated_hosts: + "{{ simulated_hosts.git + simulated_hosts.http + simulated_hosts.nexus }}" + +nginx: + ports: + - "80:80" + - "443:443" + - "10001:443" + volumes: + - "{{ app_data_path }}/cfg/nginx.conf:/etc/nginx/nginx.conf:ro" + - "{{ 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/rhel:/srv/http/repo.infra-server/rhel:rw" + - "{{ app_data_path }}/pkg/ubuntu/xenial:/srv/http/repo.infra-server/ubuntu/xenial:rw" + - /var/log/nginx:/var/log/nginx:rw diff --git a/ansible/roles/nginx/tasks/main.yml b/ansible/roles/nginx/tasks/main.yml index c59be75f..1ec0adbc 100644 --- a/ansible/roles/nginx/tasks/main.yml +++ b/ansible/roles/nginx/tasks/main.yml @@ -16,23 +16,18 @@ state: present timeout: 120 +- name: Create nexus network + docker_network: + name: nexus_network + state: present + - name: Start nginx docker_container: name: own_nginx image: own_nginx networks: - name: nexus_network - ports: - - "80:80" - - "443:443" - - "10001:443" - volumes: - - "{{ app_data_path }}/cfg/nginx.conf:/etc/nginx/nginx.conf:ro" - - "{{ 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/rhel:/srv/http/repo.infra-server/rhel:rw" - - "{{ app_data_path }}/pkg/ubuntu/xenial:/srv/http/repo.infra-server/ubuntu/xenial:rw" - - /var/log/nginx:/var/log/nginx:rw + ports: "{{ nginx.ports }}" + volumes: "{{ nginx.volumes }}" state: started restart_policy: unless-stopped |