Add the Outline playbook
This commit is contained in:
1 parent
924f000e17
commit
250456e3fe
8 files changed
+318
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# Handlers for Nginx role
|
||||
- name: Reload Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
# Tasks for Nginx role
|
||||
- name: Check if Nginx conf file exists
|
||||
stat:
|
||||
path: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
register: status
|
||||
|
||||
- name: No need to reload Nginx
|
||||
debug:
|
||||
msg: "No need to reload Nginx as sites-available entries have already been created"
|
||||
|
||||
- name: Set Nginx conf file
|
||||
when: status.stat.exists == false
|
||||
template:
|
||||
src: "files/nginx.conf.j2"
|
||||
dest: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
|
||||
- name: Enable new site
|
||||
when: status.stat.exists == false
|
||||
file:
|
||||
src: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
dest: "/etc/nginx/sites-enabled/{{ http_conf }}"
|
||||
state: link
|
||||
notify: Reload Nginx
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
# Tasks for Outline role
|
||||
- name: Pull Outline image
|
||||
docker_image:
|
||||
name: "{{ container_image }}"
|
||||
source: pull
|
||||
force_source: yes
|
||||
|
||||
- name: Ensure Outline Directory exists
|
||||
file:
|
||||
path: "/var/lib/{{ host_directory }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: Upload the .env file
|
||||
template:
|
||||
src: "files/.env"
|
||||
dest: "/var/lib/{{ host_directory }}/.env"
|
||||
|
||||
- name: Create Outline container
|
||||
docker_container:
|
||||
name: "{{ container_name }}"
|
||||
image: "{{ container_image }}"
|
||||
state: started
|
||||
restart_policy: "unless-stopped"
|
||||
env_file: "/var/lib/{{ host_directory }}/.env"
|
||||
links:
|
||||
- "postgres:db"
|
||||
- "redis:redis"
|
||||
published_ports:
|
||||
- "127.0.0.1:{{ internal_port }}:{{ internal_port }}"
|
||||
volumes:
|
||||
- "/var/lib/{{ host_directory }}:/var/lib/outline/data"
|
||||
Reference in new issue
Block a user