- 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