blob: c59be75f72c9de557b8bff83a9d24aa0fe30c335 [file] [log] [blame]
Michal Ptacek8d6f28f2018-12-19 12:13:50 +00001---
2- name: Create configuration directory
3 file:
4 path: "{{ app_data_path }}/cfg"
5 state: directory
6
7- name: Upload configuration to server
8 template:
9 src: nginx.conf.j2
10 dest: "{{ app_data_path }}/cfg/nginx.conf"
11
12- name: Load nginx image
13 docker_image:
14 name: own_nginx
15 load_path: "{{ app_data_path }}/offline_data/docker_images_infra/own_nginx_latest.tar"
16 state: present
17 timeout: 120
18
19- name: Start nginx
20 docker_container:
21 name: own_nginx
22 image: own_nginx
23 networks:
24 - name: nexus_network
25 ports:
26 - "80:80"
27 - "443:443"
28 - "10001:443"
29 volumes:
30 - "{{ app_data_path }}/cfg/nginx.conf:/etc/nginx/nginx.conf:ro"
31 - "{{ app_data_path }}/certs:/etc/nginx/certs:ro"
32 - "{{ app_data_path }}/git-repo:/srv/git:rw"
33 - "{{ app_data_path }}/http:/srv/http:rw"
Milan Verespejc2a14cf2019-02-04 11:01:19 +010034 - "{{ app_data_path }}/pkg/rhel:/srv/http/repo.infra-server/rhel:rw"
35 - "{{ app_data_path }}/pkg/ubuntu/xenial:/srv/http/repo.infra-server/ubuntu/xenial:rw"
Michal Ptacek8d6f28f2018-12-19 12:13:50 +000036 - /var/log/nginx:/var/log/nginx:rw
37 state: started
38 restart_policy: unless-stopped