From 95b73daa36b23565a8566f71f9b202d3459b685f Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 25 Jun 2023 09:52:36 -0400 Subject: Initial Commit --- roles/services/containers/kanboard/tasks/main.yml | 93 +++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 roles/services/containers/kanboard/tasks/main.yml (limited to 'roles/services/containers/kanboard/tasks') diff --git a/roles/services/containers/kanboard/tasks/main.yml b/roles/services/containers/kanboard/tasks/main.yml new file mode 100644 index 0000000..1efc16e --- /dev/null +++ b/roles/services/containers/kanboard/tasks/main.yml @@ -0,0 +1,93 @@ +- name: set image fact + set_fact: + image: kanboard/kanboard:v1.2.30 + +- name: set other facts + vars: + array: "{{ image.split('/', 1) }}" + set_fact: + repo_tag: "{{ array.1 }}" + custom_registry: "{{ docker_registry_url + '/' + docker_registry_username }}" + +- name: create kanboard directory + file: + path: "{{ docker_home }}/kanboard" + state: directory + owner: "{{ docker_username }}" + group: "{{ docker_username }}" + mode: '0755' + +- name: create data directory + file: + path: "{{ docker_home }}/kanboard/data" + state: directory + owner: "{{ docker_username }}" + group: "{{ docker_username }}" + mode: '0755' + +- name: deploy custom configuration + copy: + src: "{{ kanboard_config }}" + dest: "{{ docker_home }}/kanboard/data/config.php" + owner: "{{ docker_username }}" + group: "{{ docker_username }}" + mode: '0644' + +- name: create plugins directory + file: + path: "{{ docker_home }}/kanboard/plugins" + state: directory + owner: "{{ docker_username }}" + group: "{{ docker_username }}" + mode: '0755' + +- name: create kanboard network + become: yes + become_user: "{{ docker_username }}" + docker_network: + name: "{{ kanboard_network_name }}" + docker_host: "unix://run/user/{{ docker_uid }}/docker.sock" + driver: bridge + ipam_config: + - subnet: "{{ kanboard_subnet }}" + gateway: "{{ kanboard_gateway }}" + +- name: create and deploy kanboard container + become: yes + become_user: "{{ docker_username }}" + environment: + XDG_RUNTIME_DIR: "/run/user/{{ docker_uid }}" + docker_container: + name: "kanboard" + hostname: "kanboard" + image: "{{ image }}" + docker_host: "unix://run/user/{{ docker_uid }}/docker.sock" + purge_networks: yes + networks: + - name: "{{ kanboard_network_name }}" + ipv4_address: "{{ kanboard_ipv4 }}" + ports: + - "127.0.0.1:{{ kanboard_external_port }}:80" + volumes: + - "{{ docker_home }}/kanboard/data:/var/www/app/data" + - "{{ docker_home }}/kanboard/plugins:/var/www/app/plugins" + state: 'started' + recreate: yes + restart_policy: unless-stopped + +- name: deploy nginx configuration + notify: restart nginx + template: + src: "{{ kanboard_nginx_config }}" + dest: /etc/nginx/sites-available/kanboard.conf + owner: root + group: root + mode: '0644' + +- name: symlink site + file: + src: /etc/nginx/sites-available/kanboard.conf + dest: /etc/nginx/sites-enabled/kanboard.conf + owner: root + group: root + state: link -- cgit v1.2.3