@@ -1,2 +1,5 @@ | |||||
--- | --- | ||||
kanboard_server_name: "{{ inventory_hostname }}" | kanboard_server_name: "{{ inventory_hostname }}" | ||||
kanboard_db_name: kanboard | |||||
kanboard_db_user: kanboard | |||||
kanboard_db_pass: "{{ ansible_local[role_name].database_password }}" |
@@ -0,0 +1,6 @@ | |||||
--- | |||||
- name: kanboard configuration | |||||
template: | |||||
src: config.php.j2 | |||||
dest: /var/www/kanboard/config.php |
@@ -0,0 +1,24 @@ | |||||
--- | |||||
- name: install postgresql debian packages | |||||
apt: | |||||
pkg: | |||||
- python-psycopg2 | |||||
- python3-psycopg2 | |||||
- postgresql | |||||
- autopostgresqlbackup | |||||
- block: | |||||
- name: postgresql user | |||||
postgresql_user: | |||||
name: "{{kanboard_db_user}}" | |||||
password: "{{kanboard_db_pass}}" | |||||
- name: postgresql database | |||||
postgresql_db: | |||||
name: "{{kanboard_db_name}}" | |||||
owner: "{{kanboard_db_user}}" | |||||
become: true | |||||
become_user: postgres |
@@ -0,0 +1,16 @@ | |||||
--- | |||||
- name: ansible local facts directory | |||||
file: | |||||
path: /etc/ansible/facts.d | |||||
state: directory | |||||
- name: set ansible local fact | |||||
copy: | |||||
content: "{{_local_facts|to_json}}" | |||||
dest: /etc/ansible/facts.d/{{role_name}}.fact | |||||
register: _local_facts_set | |||||
- name: Gathering Facts | |||||
setup: | |||||
when: _local_facts_set.changed |
@@ -1,7 +1,11 @@ | |||||
--- | --- | ||||
- import_tasks: local_facts.yaml | |||||
- import_tasks: database.yaml | |||||
- import_tasks: setup.yaml | - import_tasks: setup.yaml | ||||
- import_tasks: source.yaml | - import_tasks: source.yaml | ||||
- import_tasks: config.yaml | |||||
- import_tasks: access.yaml | - import_tasks: access.yaml | ||||
- import_tasks: certificate.yaml | - import_tasks: certificate.yaml | ||||
- import_tasks: vhost.yaml | - import_tasks: vhost.yaml |
@@ -0,0 +1,10 @@ | |||||
<?php | |||||
// We choose to use Postgresql instead of Sqlite | |||||
define('DB_DRIVER', 'postgres'); | |||||
// Mysql parameters | |||||
define('DB_USERNAME', '{{kanboard_db_user}}'); | |||||
define('DB_PASSWORD', '{{kanboard_db_pass}}'); | |||||
define('DB_HOSTNAME', 'localhost'); | |||||
define('DB_NAME', '{{kanboard_db_name}}'); |
@@ -1 +1,3 @@ | |||||
--- | --- | ||||
_local_facts: | |||||
database_password: "{% if not ansible_local[role_name].database_password is defined %}{{ lookup('password', '/dev/null length=16 chars=ascii_letters') }}{% else %}{{ ansible_local[role_name].database_password }}{% endif %}" |