diff --git a/ansible/nuc.yaml b/ansible/nuc.yaml index 4d8b8d5..9f1202a 100644 --- a/ansible/nuc.yaml +++ b/ansible/nuc.yaml @@ -10,3 +10,11 @@ apply: tags: - setup + - name: Setup the docker based services + tags: + - services + ansible.builtin.include_role: + name: services + apply: + tags: + - services diff --git a/ansible/roles/services/tasks/main.yaml b/ansible/roles/services/tasks/main.yaml new file mode 100644 index 0000000..357662d --- /dev/null +++ b/ansible/roles/services/tasks/main.yaml @@ -0,0 +1,15 @@ +- name: Ensure docker compose directory is present + ansible.builtin.file: + path: compose + state: directory +- name: Copy in the docker-compose template + ansible.builtin.template: + src: compose.yaml + dest: compose/compose.yaml + owner: nigel + mode: "0644" +- name: Run the docker compose yaml + become: true + community.docker.docker_compose_v2: + project_src: compose + remove_orphans: true \ No newline at end of file diff --git a/ansible/roles/services/templates/compose.yaml b/ansible/roles/services/templates/compose.yaml new file mode 100644 index 0000000..db3f3c4 --- /dev/null +++ b/ansible/roles/services/templates/compose.yaml @@ -0,0 +1,6 @@ +services: + health: + image: nginx:latest + container_name: health + ports: + - "8080:80" \ No newline at end of file