-
Notifications
You must be signed in to change notification settings - Fork 0
/
buillddocker.yml
34 lines (30 loc) · 975 Bytes
/
buillddocker.yml
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
- name: Build Docker image and start container Kubespray
hosts: utils03
gather_facts: false
tasks:
- name: pull image
command: docker pull quay.io/kubespray/kubespray:v2.24.2
- name: Stop the old container
community.docker.docker_container:
name: kubespray
state: stopped
ignore_errors: yes # Ignore errors if the container is not running
- name: Remove the old container
community.docker.docker_container:
name: kubespray
state: absent
ignore_errors: yes
- name: Remove the old Docker image
community.docker.docker_image:
name: kubespray:master
state: absent
- name: Start Docker container
docker_container:
name: kubespray
#image: kubespray:latest
image: quay.io/kubespray/kubespray:v2.24.2
state: started
interactive: true
tty: true
volumes:
- /root/inventory:/kubespray/inventory