diff --git a/echo.yml b/echo.yml new file mode 100644 index 0000000..2c11375 --- /dev/null +++ b/echo.yml @@ -0,0 +1,27 @@ +- name: Pull and run private GHCR image + hosts: all + become: true + + tasks: + - name: Ensure community.docker collection is installed + ansible.builtin.ansible_galaxy_collection: + name: community.docker + + - name: Log in to GitHub Container Registry + community.docker.docker_login: + registry_url: ghcr.io + username: "{{ ghcr_username }}" + password: "{{ ghcr_token }}" + + - name: Pull image from GHCR + community.docker.docker_image: + name: "{{ image_name }}" + source: pull + + - name: Run container from image + community.docker.docker_container: + name: echo + image: "{{ image_name }}" + restart_policy: always + ports: + - "3000:3000" \ No newline at end of file