37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
- name: Mount the container data folder
|
|
ansible.builtin.include_role:
|
|
role: docker/container-data
|
|
vars:
|
|
dir_name: "{{ directory }}"
|
|
|
|
- name: Create files folder
|
|
ansible.builtin.file:
|
|
dest: "/home/docker/container-data/{{ directory }}/files"
|
|
state: directory
|
|
mode: '0777'
|
|
|
|
- name: Create config folder
|
|
ansible.builtin.file:
|
|
dest: "/home/docker/container-data/{{ directory }}/config"
|
|
state: directory
|
|
mode: '0777'
|
|
|
|
- name: Create config folder
|
|
ansible.builtin.file:
|
|
dest: "/home/docker/container-data/{{ directory }}/database"
|
|
state: directory
|
|
mode: '0777'
|
|
|
|
- name: Deploy filebrowser container
|
|
community.docker.docker_container:
|
|
name: "{{ container_name }}"
|
|
pull: true
|
|
state: started
|
|
restart_policy: unless-stopped
|
|
image: filebrowser/filebrowser
|
|
ports:
|
|
- '{{ port }}:80'
|
|
volumes:
|
|
- '/home/docker/container-data/{{ directory }}/config:/config'
|
|
- '/home/docker/container-data/{{ directory }}/database:/database'
|
|
- '/home/docker/container-data/{{ directory }}/files:/srv' |