--- - name: Install system dependencies apt: pkg: - aptitude - apt-transport-https - ca-certificates - curl - software-properties-common - python3-pip - virtualenv - python3-setuptools state: latest update_cache: true - name: Add Docker GPG apt Key apt_key: url: https://download.docker.com/linux/ubuntu/gpg state: present - name: Add Docker Repository apt_repository: repo: deb https://download.docker.com/linux/ubuntu noble stable state: present - name: Install Docker CE apt: name: docker-ce state: latest update_cache: true - name: Install Docker Python module pip: name: docker - name: Configure Docker for LXC compatibility copy: content: | { "storage-driver": "vfs" } dest: /etc/docker/daemon.json notify: restart docker - name: Ensure Docker daemon is running systemd: name: docker state: started enabled: yes - name: Create directories for services file: path: "{{ item.path }}" state: directory mode: '0755' loop: - { path: "{{ heimdall.config_dir }}" } - { path: "{{ npm.data_dir }}" } - { path: "{{ npm.letsencrypt_dir }}" } - name: Pull Docker images community.docker.docker_image: name: "{{ item.image }}" source: pull loop: - { image: "{{ heimdall.image }}" } - { image: "{{ npm.image }}" } - name: Deploy Heimdall container community.docker.docker_container: name: heimdall image: "{{ heimdall.image }}" state: started restart_policy: unless-stopped ports: - "{{ heimdall.port }}" volumes: - "{{ heimdall.config_dir }}:/config" env: PUID: "{{ heimdall.user_id }}" PGID: "{{ heimdall.group_id }}" TZ: "{{ heimdall.timezone }}" - name: Deploy NPM container community.docker.docker_container: name: npm image: "{{ npm.image }}" state: started restart_policy: unless-stopped ports: "{{ npm.ports }}" volumes: - "{{ npm.data_dir }}:/data" - "{{ npm.letsencrypt_dir }}:/etc/letsencrypt"