-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.yml
More file actions
42 lines (39 loc) · 1.1 KB
/
Copy pathtest.yml
File metadata and controls
42 lines (39 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
- hosts: localhost
gather_facts: false
vars:
container_name: "ansible-test-{{ '' | to_uuid }}"
recreate_test_env: false
tasks:
- name: Build test container
community.docker.docker_image:
build:
path: ./test-env
name: kalkspace-infra-test-env
source: build
# needed to get the image id, will use cache
force_source: true
register: test_env
- name: Bring up docker container
community.docker.docker_container:
name: "{{ container_name }}"
image: "{{ test_env.image.Id }}"
command: ["sleep", "infinity"]
detach: true
recreate: "{{ recreate_test_env }}"
force_kill: true
container_default_behavior: "no_defaults"
- name: Add to inventory
add_host:
name: "{{ container_name }}"
groups: docker_test
ansible_connection: community.docker.docker
ansible_python_interpreter: /usr/bin/python3
changed_when: false
- hosts: docker_test
vars_files:
- vault/test-dummies.yml
vars:
skip_handlers: true
roles:
- metrics