- name: Create service directory
file:
path: "{{ service_dir }}"
state: directory
- name: Clone git repo
git:
repo: "{{ git_origin }}"
dest: "{{ service_dir }}/git"
register: repo
- name: Add open permissions for git repo
path: "{{ service_dir }}/git"
mode: 0757
- name: Generate static files
command:
cmd: "docker run --rm --volume=\"{{ service_dir }}/git:/srv/jekyll:Z\" -it jekyll/minimal jekyll build"
chdir: "{{ service_dir }}"
when: repo.changed
- name: Copy security.txt
copy:
src: "{{ role_path }}/files/security.txt"
dest: "{{ service_dir }}/security.txt"
- name: Copy docker compose file
template:
src: "{{ role_path }}/templates/docker-compose.yml.j2"
dest: "{{ service_dir }}/docker-compose.yml"
- name: Copy nginx config
src: "{{ role_path }}/templates/nginx.conf.j2"
dest: "{{ service_dir }}/nginx.conf"
register: nginx_conf
- name: Start docker compose
docker_compose:
project_src: "{{ service_dir }}"
pull: true
remove_orphans: true
restarted: "{{ nginx_conf.changed }}"