This repository has been archived on 2023-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
max/roles/static/tasks/main.yml

39 lines
1.1 KiB
YAML
Raw Normal View History

2023-01-26 07:20:38 +00:00
- 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
file:
path: "{{ service_dir }}/git"
state: directory
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"
2023-01-26 07:20:38 +00:00
- name: Copy docker compose file
template:
src: "{{ role_path }}/templates/docker-compose.yml.j2"
dest: "{{ service_dir }}/docker-compose.yml"
- name: Copy nginx config
2023-02-08 07:27:30 +00:00
template:
src: "{{ role_path }}/templates/nginx.conf.j2"
2023-01-26 07:20:38 +00:00
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 }}"