mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-22 12:41:05 +01:00
Added seperat redis
This commit is contained in:
parent
6836ceebdd
commit
cda6f1a8dc
@ -2,4 +2,4 @@
|
|||||||
- name: recreate discourse
|
- name: recreate discourse
|
||||||
command:
|
command:
|
||||||
cmd: ./launcher rebuild app
|
cmd: ./launcher rebuild app
|
||||||
chdir: "{{docker_compose_instance_directory}}"
|
chdir: "{{discourse_repository_directory}}"
|
||||||
|
@ -18,30 +18,51 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: checkout repository
|
- name: add docker-compose.yml
|
||||||
ansible.builtin.shell: git checkout .
|
template: src=docker-compose.yml.j2 dest={{docker_compose_instance_directory}}docker-compose.yml
|
||||||
become: true
|
notify: docker compose project setup
|
||||||
args:
|
|
||||||
chdir: "{{docker_compose_instance_directory}}"
|
- name: flush, to recreate discourse docker compose
|
||||||
ignore_errors: true
|
meta: flush_handlers
|
||||||
|
when: enable_central_database | bool
|
||||||
|
|
||||||
- name: pull docker repository
|
- name: pull docker repository
|
||||||
git:
|
git:
|
||||||
repo: "https://github.com/discourse/discourse_docker.git"
|
repo: "https://github.com/discourse/discourse_docker.git"
|
||||||
dest: "{{docker_compose_instance_directory}}"
|
dest: "{{discourse_repository_directory}}"
|
||||||
update: yes
|
update: yes
|
||||||
notify: recreate discourse
|
notify: recreate discourse
|
||||||
become: true
|
become: true
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: set chmod 700 for {{docker_compose_instance_directory}}containers
|
- name: set chmod 700 for {{discourse_repository_directory}}containers
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{docker_compose_instance_directory}}/containers"
|
path: "{{discourse_repository_directory}}/containers"
|
||||||
mode: '700'
|
mode: '700'
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: "copy configuration to {{docker_compose_instance_directory}}containers/app.yml"
|
- name: "copy configuration to {{discourse_repository_directory}}containers/app.yml"
|
||||||
template:
|
template:
|
||||||
src: app.yml.j2
|
src: app.yml.j2
|
||||||
dest: "{{docker_compose_instance_directory}}containers/app.yml"
|
dest: "{{discourse_repository_directory}}containers/app.yml"
|
||||||
notify: recreate discourse
|
notify: recreate discourse
|
||||||
|
|
||||||
|
- name: "Ensure {{docker_compose_project_name}}_default_network network exists"
|
||||||
|
community.docker.docker_network:
|
||||||
|
name: "{{docker_compose_project_name}}_default_network"
|
||||||
|
state: present
|
||||||
|
when: enable_central_database | bool
|
||||||
|
|
||||||
|
- name: "add central database temporary to {{docker_compose_project_name}}_default_network"
|
||||||
|
command:
|
||||||
|
cmd: "docker network connect discourse_default_network central-{{ database_type }}"
|
||||||
|
when: enable_central_database | bool
|
||||||
|
|
||||||
|
- name: flush, to recreate discourse app
|
||||||
|
meta: flush_handlers
|
||||||
|
when: enable_central_database | bool
|
||||||
|
|
||||||
|
- name: "remove central database from {{docker_compose_project_name}}_default_network"
|
||||||
|
command:
|
||||||
|
cmd: "docker network disconnect discourse_default_network central-{{ database_type }}"
|
||||||
|
when: enable_central_database | bool
|
||||||
|
@ -1,17 +1,8 @@
|
|||||||
## this is the all-in-one, standalone Discourse Docker container template
|
|
||||||
##
|
|
||||||
## After making changes to this file, you MUST rebuild
|
|
||||||
## /var/discourse/launcher rebuild app
|
|
||||||
##
|
|
||||||
## BE *VERY* CAREFUL WHEN EDITING!
|
|
||||||
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
|
|
||||||
## visit http://www.yamllint.com/ to validate this file as needed
|
|
||||||
|
|
||||||
templates:
|
templates:
|
||||||
{% if not enable_central_database | bool %}
|
{% if not enable_central_database | bool %}
|
||||||
- "templates/postgres.template.yml"
|
- "templates/postgres.template.yml"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- "templates/redis.template.yml"
|
#- "templates/redis.template.yml"
|
||||||
- "templates/web.template.yml"
|
- "templates/web.template.yml"
|
||||||
## Uncomment the next line to enable the IPv6 listener
|
## Uncomment the next line to enable the IPv6 listener
|
||||||
#- "templates/web.ipv6.template.yml"
|
#- "templates/web.ipv6.template.yml"
|
||||||
@ -25,7 +16,6 @@ templates:
|
|||||||
## see https://meta.discourse.org/t/17247 for details
|
## see https://meta.discourse.org/t/17247 for details
|
||||||
expose:
|
expose:
|
||||||
- "127.0.0.1:{{http_port}}:80" # http
|
- "127.0.0.1:{{http_port}}:80" # http
|
||||||
#- "443:443" # https
|
|
||||||
|
|
||||||
params:
|
params:
|
||||||
db_default_text_search_config: "pg_catalog.english"
|
db_default_text_search_config: "pg_catalog.english"
|
||||||
@ -73,13 +63,14 @@ env:
|
|||||||
DISCOURSE_SMTP_DOMAIN: {{ system_email_domain }}
|
DISCOURSE_SMTP_DOMAIN: {{ system_email_domain }}
|
||||||
DISCOURSE_NOTIFICATION_EMAIL: {{ system_email }}
|
DISCOURSE_NOTIFICATION_EMAIL: {{ system_email }}
|
||||||
|
|
||||||
{% if enable_central_database | bool %}
|
|
||||||
# Database Configuration
|
# Database Configuration
|
||||||
DISCOURSE_DB_USERNAME: {{ database_username }}
|
DISCOURSE_DB_USERNAME: {{ database_username }}
|
||||||
DISCOURSE_DB_PASSWORD: {{ database_password }}
|
DISCOURSE_DB_PASSWORD: {{ database_password }}
|
||||||
DISCOURSE_DB_HOST: {{ database_host }}
|
DISCOURSE_DB_HOST: {{ database_host }}
|
||||||
DISCOURSE_DB_NAME: {{ database_databasename }}
|
DISCOURSE_DB_NAME: {{ database_databasename }}
|
||||||
{% endif %}
|
|
||||||
|
# Redis Configuration
|
||||||
|
DISCOURSE_REDIS_HOST: {{docker_compose_project_name}}-redis
|
||||||
|
|
||||||
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
|
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
|
||||||
#LETSENCRYPT_ACCOUNT_EMAIL: administrator@veen.world
|
#LETSENCRYPT_ACCOUNT_EMAIL: administrator@veen.world
|
||||||
@ -127,7 +118,5 @@ run:
|
|||||||
- exec: echo "End of custom commands"
|
- exec: echo "End of custom commands"
|
||||||
|
|
||||||
docker_args:
|
docker_args:
|
||||||
{% if enable_central_database | bool %}
|
- --network={{docker_compose_project_name}}_default_network
|
||||||
- --network=central_{{ database_type }}_network
|
|
||||||
{% endif %}
|
|
||||||
- --name=discourse_application
|
- --name=discourse_application
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
docker_compose_project_name: "discourse"
|
docker_compose_project_name: "discourse"
|
||||||
database_password: "{{ baserow_database_password }}"
|
database_password: "{{ baserow_database_password }}"
|
||||||
database_type: "postgres"
|
database_type: "postgres"
|
||||||
|
discourse_repository_directory: "{{ path_docker_compose_instances + docker_compose_project_name + '/repository/' }}"
|
@ -4,5 +4,5 @@ networks:
|
|||||||
central_{{ database_type }}_network:
|
central_{{ database_type }}_network:
|
||||||
external: true
|
external: true
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{docker_compose_project_name}}_network:
|
default_network:
|
||||||
{{ "\n" }}
|
{{ "\n" }}
|
@ -1,6 +1,6 @@
|
|||||||
# This template needs to be included in docker-compose.yml containers
|
# This template needs to be included in docker-compose.yml containers
|
||||||
networks:
|
networks:
|
||||||
{{docker_compose_project_name}}_network:
|
default_network:
|
||||||
{% if enable_central_database | bool %}
|
{% if enable_central_database | bool %}
|
||||||
central_{{ database_type }}_network:
|
central_{{ database_type }}_network:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# This template needs to be included in docker-compose.yml, which depend on a mariadb database
|
# This template needs to be included in docker-compose.yml, which depend on a mariadb database
|
||||||
{% if not enable_central_database | bool %}
|
{% if not enable_central_database | bool %}
|
||||||
database:
|
database:
|
||||||
|
container_name: {{docker_compose_project_name}}-mariadb
|
||||||
logging:
|
logging:
|
||||||
driver: journald
|
driver: journald
|
||||||
image: mariadb
|
image: mariadb
|
||||||
@ -20,6 +21,6 @@
|
|||||||
timeout: 1s
|
timeout: 1s
|
||||||
retries: 5
|
retries: 5
|
||||||
networks:
|
networks:
|
||||||
- {{docker_compose_project_name}}_network
|
- default_network
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ "\n" }}
|
{{ "\n" }}
|
@ -2,6 +2,7 @@
|
|||||||
{% if not enable_central_database | bool %}
|
{% if not enable_central_database | bool %}
|
||||||
database:
|
database:
|
||||||
image: postgres:{{database_version}}-alpine
|
image: postgres:{{database_version}}-alpine
|
||||||
|
container_name: {{docker_compose_project_name}}-postgres
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_PASSWORD={{database_password}}
|
- POSTGRES_PASSWORD={{database_password}}
|
||||||
- POSTGRES_USER={{database_username}}
|
- POSTGRES_USER={{database_username}}
|
||||||
@ -18,6 +19,6 @@
|
|||||||
source: database
|
source: database
|
||||||
target: /var/lib/postgresql/data
|
target: /var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
- {{docker_compose_project_name}}_network
|
- default_network
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ "\n" }}
|
{{ "\n" }}
|
@ -1,6 +1,7 @@
|
|||||||
# This template needs to be included in docker-compose.yml, which depend on redis
|
# This template needs to be included in docker-compose.yml, which depend on redis
|
||||||
redis:
|
redis:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
|
container_name: {{docker_compose_project_name}}-redis
|
||||||
restart: always
|
restart: always
|
||||||
logging:
|
logging:
|
||||||
driver: journald
|
driver: journald
|
||||||
@ -12,5 +13,5 @@
|
|||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 30
|
retries: 30
|
||||||
networks:
|
networks:
|
||||||
- {{docker_compose_project_name}}_network
|
- default_network
|
||||||
{{ "\n" }}
|
{{ "\n" }}
|
Loading…
Reference in New Issue
Block a user