--- - name: Docker apps hosts: tamriel remote_user: root vars: docker_compose_dir: "~/compose" vars_files: - domains.yml - secrets.yml tasks: - name: Remove old config tags: ["config"] file: path: "{{docker_compose_dir}}" state: absent - name: Synchronize docker-compose files tags: ["config"] synchronize: src: compose/ dest: "{{docker_compose_dir}}" - name: Copy main nginx.conf tags: ["nginx"] copy: src: nginx/nginx.conf dest: /etc/nginx/nginx.conf mode: '0644' owner: root group: root - name: Copy nginx site files tags: ["nginx"] copy: src: nginx/conf.d/ dest: /etc/nginx/conf.d mode: '0644' owner: root group: root - name: Generate nginx conf tags: ["nginx"] template: src: templates/nginx.conf.j2 dest: "/etc/nginx/conf.d/{{short_name}}.conf" vars: server: "{{item.value}}" short_name: "{{item.key}}" with_items: "{{domains | dict2items}}" when: (item.value.disabled is undefined) or (item.value.disabled != true) - name: Copy sites tags: ["nginx"] copy: src: nginx/main/ dest: /var/www/html mode: '0644' owner: www-data group: www-data - name: Copy sites tags: ["nginx"] copy: src: nginx/darling/ dest: /var/www/html/darling mode: '0644' owner: www-data group: www-data - name: reload nginx conf tags: ["nginx"] systemd: name: nginx state: reloaded - name: counter pod tags: ["podman", "counter"] containers.podman.podman_pod: name: "counter" ports: - "127.0.0.1:{{domains.cnt.proxy.port}}:5000" - name: counter redis tags: ["podman", "counter"] containers.podman.podman_container: name: redis image: docker.io/redis:alpine pod: "counter" - name: counter image tags: ["podman", "counter"] containers.podman.podman_image: name: dybiec.info/counter path: "{{docker_compose_dir}}/app" pull: no force: yes - name: counter tags: ["podman", "counter"] containers.podman.podman_container: name: counter_app image: dybiec.info/counter:latest image_strict: yes pod: "counter" - name: csgo image tags: ["podman", "csgo"] containers.podman.podman_image: name: dybiec.info/csgo path: "{{docker_compose_dir}}/cs/" pull: no force: yes - name: csgo tags: ["podman", "csgo"] containers.podman.podman_container: name: cs image: dybiec.info/csgo:latest image_strict: yes ports: - "127.0.0.1:{{domains.cs.proxy.port}}:5000" - name: openvpn tags: ["podman", "openvpn"] containers.podman.podman_container: name: openvpn image: docker.io/kylemanna/openvpn network: host volume: - "/root/openvpn:/etc/openvpn" privileged: true