49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
---
|
|
- name: Crea cartella app
|
|
ansible.builtin.file:
|
|
path: /opt/semaphore-splash
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Render index HTML
|
|
ansible.builtin.template:
|
|
src: index.html.j2
|
|
dest: /opt/semaphore-splash/index.html
|
|
mode: '0644'
|
|
|
|
- name: Render config Nginx
|
|
ansible.builtin.template:
|
|
src: nginx.conf.j2
|
|
dest: /opt/semaphore-splash/nginx.conf
|
|
mode: '0644'
|
|
|
|
- name: Ferma eventuale container precedente
|
|
community.docker.docker_container:
|
|
name: "{{ container_name }}"
|
|
state: absent
|
|
|
|
- name: Scarica immagine Nginx
|
|
community.docker.docker_image:
|
|
name: "{{ nginx_image }}"
|
|
tag: "{{ nginx_version }}"
|
|
source: pull
|
|
|
|
- name: Avvia container Nginx demo
|
|
community.docker.docker_container:
|
|
name: "{{ container_name }}"
|
|
image: "{{ nginx_image }}:{{ nginx_version }}"
|
|
state: started
|
|
restart_policy: unless-stopped
|
|
ports:
|
|
- "{{ app_port }}:80"
|
|
volumes:
|
|
- /opt/semaphore-splash/index.html:/usr/share/nginx/html/index.html:ro
|
|
- /opt/semaphore-splash/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
env:
|
|
APP_ENV: "{{ app_environment }}"
|
|
GREETING_MESSAGE: "{{ greeting_message }}"
|
|
APP_SECRET: "{{ app_secret }}"
|
|
RELEASE_ID: "{{ release_id }}"
|
|
ACCENT_COLOR: "{{ accent_color }}"
|
|
SECONDARY_COLOR: "{{ secondary_color }}"
|