diff options
author | Michal Ptacek <m.ptacek@partner.samsung.com> | 2018-12-19 12:13:50 +0000 |
---|---|---|
committer | Michal Ptacek <m.ptacek@partner.samsung.com> | 2018-12-19 12:13:50 +0000 |
commit | 8d6f28f96155f705aeba94fa7c5e630bd497d1ac (patch) | |
tree | 023df56febb44743723c980114a27c70bf82eabb /ansible/roles/nginx/tasks | |
parent | d21977bd82508b90c8bfda24111ac4a693256e70 (diff) |
Adding nginx role
nginx is crucial part of our offline solution, within this role
we are covering deployment of this lightweight http server
together with its configuration.
Change-Id: I89695074349f4c6938340ab3bb735108c8c278f4
Issue-ID: OOM-1551
Signed-off-by: Michal Ptacek <m.ptacek@partner.samsung.com>
Diffstat (limited to 'ansible/roles/nginx/tasks')
-rw-r--r-- | ansible/roles/nginx/tasks/main.yml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ansible/roles/nginx/tasks/main.yml b/ansible/roles/nginx/tasks/main.yml new file mode 100644 index 00000000..5c010848 --- /dev/null +++ b/ansible/roles/nginx/tasks/main.yml @@ -0,0 +1,37 @@ +--- +- name: Create configuration directory + file: + path: "{{ app_data_path }}/cfg" + state: directory + +- name: Upload configuration to server + template: + src: nginx.conf.j2 + dest: "{{ app_data_path }}/cfg/nginx.conf" + +- name: Load nginx image + docker_image: + name: own_nginx + load_path: "{{ app_data_path }}/offline_data/docker_images_infra/own_nginx_latest.tar" + state: present + timeout: 120 + +- 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:rw" + - /var/log/nginx:/var/log/nginx:rw + state: started + restart_policy: unless-stopped |