blob: 5c010848d30fe230aad66051c289ad98c56feaf5 [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"
34 - "{{ app_data_path }}/pkg/rhel:/srv/http/repo.infra-server:rw"
35 - /var/log/nginx:/var/log/nginx:rw
36 state: started
37 restart_policy: unless-stopped