--- - name: Create Bookstack directory structure file: path: "{{ item }}" state: directory mode: 0755 loop: - "{{ bookstack_base_dir }}" - "{{ bookstack_config_dir }}" - "{{ bookstack_uploads_dir }}" - "{{ bookstack_db_dir }}" when: not item.stat.exists - name: Check if Bookstack directories exist assert: that: - item.stat.exists fail_msg: "Directory {{ item.path }} does not exist. Please create it manually." loop: - { path: "{{ bookstack_config_dir }}" } - { path: "{{ bookstack_uploads_dir }}" } - { path: "{{ bookstack_db_dir }}" } - name: Deploy Bookstack docker-compose.yml template: src: docker-compose.yml.j2 dest: "{{ bookstack_base_dir }}/docker-compose.yml" mode: 0644 - name: Start Bookstack services shell: | cd {{ bookstack_base_dir }} docker compose up -d args: executable: /bin/bash - name: Wait for services to start pause: seconds: 15 - name: Check Bookstack container status shell: docker ps --filter name=bookstack-mnemo register: bookstack_status changed_when: false - name: Show Bookstack status debug: var: bookstack_status.stdout