diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index f4183ac..a54eaa1 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -22,6 +22,11 @@ name: "docker-compose" state: present +- name: create folder structure for bind mounts + file: + name: "{{ volume_root_folder }}" + state: directory + - name: setup services import_tasks: services.yml tags: diff --git a/roles/docker/tasks/services/privatebin.yml b/roles/docker/tasks/services/privatebin.yml index b60755e..d6ab54b 100644 --- a/roles/docker/tasks/services/privatebin.yml +++ b/roles/docker/tasks/services/privatebin.yml @@ -1,7 +1,17 @@ --- -- name: privatebin volume - docker_volume: - name: privatebin + +- name: create privatebin volume folders + file: + name: "{{ privatebin.volume_folder }}/{{ item }}" + state: directory + with_items: + - cfg + - data + +- name: upload privatebin config + template: + src: files/configs/privatebin-conf.php + dest: "{{ privatebin.volume_folder }}/cfg/conf.php" - name: privatebin app container docker_container: @@ -9,7 +19,8 @@ image: jgeusebroek/privatebin:latest restart_policy: unless-stopped volumes: - - privatebin:/privatebin + - "{{ privatebin.volume_folder }}/cfg:/privatebin/cfg" + - "{{ privatebin.volume_folder }}/data:/privatebin/data" networks: - name: external_services env: