k-space-infra-automation/ansible/kanban/deploy_wekan.yml
2019-11-08 00:46:58 +02:00

86 lines
1.6 KiB
YAML

---
- hosts: kanban
become: yes
become_user: root
become_method: sudo
tasks:
- name: create app group
group:
name: wekan
state: present
- name: create app user
user:
name: wekan
append: yes
group: wekan
groups: docker
shell: /bin/false
# - name: create .ssh directory
# file:
# path: /home/wekan/.ssh
# state: directory
# mode: 0700
# owner: wekan
# - name: move ssh key
# copy:
# src: ~/.ssh/id_whysthatso
# dest: /home/wekan/.ssh/id_whysthatso
# directory_mode: 0700
# owner: wekan
# group: wekan
# mode: 0600
- name: create app directory
file:
path: /opt/wekan
state: directory
mode: 0755
owner: wekan
group: wekan
- name: create db directory
file:
path: /opt/wekan/{{ item }}
state: directory
mode: 0755
owner: wekan
group: wekan
with_items:
- db
- uploads
- db-dump
- name: configure wekan
template:
dest: /opt/wekan/{{ item }}
src: "{{ item }}"
owner: wekan
group: wekan
with_items:
- docker-compose.yml
register: wekan_config
- name: fix file permissions
file:
path: /opt/wekan
state: directory
recurse: yes
owner: wekan
group: wekan
- name: restart wekan service
service:
name: docker-compose@wekan
state: restarted
when: wekan_config.changed
- name: enable wekan service
service:
name: docker-compose@wekan
state: started
enabled: yes