mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-25 22:21:04 +01:00
Compare commits
6 Commits
fe0ee86319
...
0b4e8c5c6a
Author | SHA1 | Date | |
---|---|---|---|
0b4e8c5c6a | |||
383b80df6b | |||
9ef2c0d3ae | |||
a8ee870ef5 | |||
c7d6e8c68c | |||
f180c14e06 |
@ -1,12 +1,16 @@
|
||||
# General
|
||||
reset_files: false # Cleans up all CyMaIS files. It's necessary to run to whole playbook and not particial roles when using this function.
|
||||
verbose: false # Prints well formated debug information
|
||||
test_run: false # Executes test routines instead of productive routines
|
||||
database_delay: "0" # Database delay to wait for the central database before continue tasks
|
||||
top_domain: "localhost" # Change this in inventory to your domain
|
||||
ip4_address: "127.0.0.1" # Change thie in inventory to the ip address of your server
|
||||
backups_folder_path: "/Backups/" # Path to the backups folder
|
||||
|
||||
# Mode
|
||||
|
||||
# The following modes can be combined with each other
|
||||
mode_reset: false # Cleans up all CyMaIS files. It's necessary to run to whole playbook and not particial roles when using this function.
|
||||
mode_verbose: false # Prints well formated debug information
|
||||
mode_test: false # Executes test routines instead of productive routines
|
||||
|
||||
# Server Tact Variables
|
||||
|
||||
## Ours in which the server is 100% working. Rest of the time is reserved for maintanance
|
||||
|
@ -3,7 +3,6 @@
|
||||
name:
|
||||
- lsof
|
||||
- python-pandas
|
||||
- jq
|
||||
state: present
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
@ -45,7 +44,7 @@
|
||||
file:
|
||||
path: "{{ backup_docker_to_local_folder }}databases.csv"
|
||||
state: absent
|
||||
when: reset_files | bool and run_once_backup_docker_to_local is not defined
|
||||
when: mode_reset | bool and run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: seed database values
|
||||
command:
|
||||
|
@ -16,19 +16,19 @@
|
||||
command:
|
||||
cmd: "docker stop discourse_application"
|
||||
ignore_errors: true
|
||||
when: reset_files | bool
|
||||
when: mode_reset | bool
|
||||
|
||||
- name: "rm container discourse_application"
|
||||
command:
|
||||
cmd: "docker rm discourse_application"
|
||||
ignore_errors: true
|
||||
when: reset_files | bool
|
||||
when: mode_reset | bool
|
||||
|
||||
- name: "cleanup central database from {{docker_compose_project_name}}_default network"
|
||||
command:
|
||||
cmd: "docker network disconnect discourse_default central-{{ database_type }}"
|
||||
ignore_errors: true
|
||||
when: reset_files | bool
|
||||
when: mode_reset | bool
|
||||
|
||||
- name: add docker-compose.yml
|
||||
template: src=docker-compose.yml.j2 dest={{docker_compose_instance_directory}}docker-compose.yml
|
||||
|
@ -65,11 +65,10 @@
|
||||
become: false
|
||||
delegate_to: localhost
|
||||
|
||||
|
||||
- name: show variable information
|
||||
debug:
|
||||
msg: "hosts_path: {{hosts_path}}\nmatrix_inventory_tmp_dir:{{ matrix_inventory_tmp_dir }}"
|
||||
when: verbose | bool
|
||||
when: mode_verbose | bool
|
||||
|
||||
- name: install requirements
|
||||
local_action: command just roles
|
||||
|
@ -1,6 +1,9 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
|
||||
{% include 'templates/docker-service-' + database_type + '.yml.j2' %}
|
||||
|
||||
application:
|
||||
logging:
|
||||
driver: journald
|
||||
|
@ -2,12 +2,15 @@
|
||||
- name: "include task receive certbot certificate"
|
||||
include_tasks: recieve-certbot-certificate.yml
|
||||
vars:
|
||||
domain: "{{ domain }}"
|
||||
domain: "{{item.source}}"
|
||||
loop: "{{domain_mappings}}"
|
||||
|
||||
- name: configure nginx redirect configurations
|
||||
vars:
|
||||
domain: "{{item.source}}"
|
||||
target_domain: "{{item.target}}"
|
||||
template: src=redirect.domain.nginx.conf.j2 dest={{nginx_servers_directory}}{{ domain }}.conf
|
||||
template:
|
||||
src: redirect.domain.nginx.conf.j2
|
||||
dest: "{{nginx_servers_directory}}{{ domain }}.conf"
|
||||
loop: "{{domain_mappings}}"
|
||||
notify: restart nginx
|
||||
|
@ -9,7 +9,7 @@
|
||||
file:
|
||||
path: "{{ docker_compose_instance_directory }}"
|
||||
state: absent
|
||||
when: reset_files | bool
|
||||
when: mode_reset | bool
|
||||
|
||||
- name: "create {{docker_compose_instance_directory}}"
|
||||
file:
|
||||
|
@ -1,5 +1,5 @@
|
||||
- name: recieve certbot certificate for {{ domain }}
|
||||
- name: "recieve certbot certificate for {{ domain }}"
|
||||
command: >-
|
||||
certbot certonly --agree-tos --email {{ administrator_email }}
|
||||
--non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ domain }}
|
||||
{{ '--test-cert' if test_run | bool else '' }}
|
||||
{{ '--test-cert' if mode_test | bool else '' }}
|
@ -7,7 +7,7 @@
|
||||
- POSTGRES_PASSWORD={{database_password}}
|
||||
- POSTGRES_USER={{database_username}}
|
||||
- POSTGRES_DB={{database_name}}
|
||||
- POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C"
|
||||
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale=C
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U {{database_name}}"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
database_instance: "{{ 'central-' + database_type if enable_central_database else docker_compose_project_name }}"
|
||||
database_host: "{{ 'central-' + database_type if enable_central_database else 'database' }}"
|
||||
database_instance: "{{ 'central-' + database_type if enable_central_database | bool else docker_compose_project_name }}"
|
||||
database_host: "{{ 'central-' + database_type if enable_central_database | bool else 'database' }}"
|
||||
database_name: "{{ docker_compose_project_name }}"
|
||||
database_username: "{{ docker_compose_project_name }}"
|
||||
database_version: "{{ postgres_default_version }}"
|
Loading…
Reference in New Issue
Block a user