Skip to content

Commit

Permalink
Add new role "install-docker" (apache#571)
Browse files Browse the repository at this point in the history
The new role "install-docker" install docker-ce by using get.docker.com
script, it support multiple OS and arch, and keep consistent docker-ce
version, mark role "install-docker-ce" as deprecated, and apply new role
in all of docker-machine jobs. Update tag of docker-machine job from
latest-release to 18.06 in order to avoid confusions.

Related-Bug: theopenlab/openlab#308
  • Loading branch information
kiwik authored and huangtianhua committed Jun 28, 2019
1 parent 7d8cb34 commit 5d90f8f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 13 deletions.
11 changes: 6 additions & 5 deletions roles/config-docker-machine/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
include_role:
name: config-golang

- name: Install Runtime Docker CE
include_role:
name: install-docker
vars:
docker_version: '18.06'

- name: Compiled and install docker-machine from source
shell:
cmd: |
set -ex
# Install docker
apt-get update
apt-get install apt-transport-https ca-certificates -y
wget -qO- https://get.docker.com/ | sh
# Build docker-machine
make build
cp ./bin/docker-machine /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion roles/install-docker-ce/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Install Runtime Docker CE using the repository
- name: (Deprecated, instead by "install-docker") Install Runtime Docker CE using the repository
shell:
cmd: |
set -x
Expand Down
2 changes: 2 additions & 0 deletions roles/install-docker/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
docker_version: "latest"
34 changes: 34 additions & 0 deletions roles/install-docker/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- name: Install Docker CE {{ docker_version }} using get.docker.com
shell:
cmd: |
set -x
set -e
# Download docker install script
# The script worked on multiple OS (Ubuntu, CentOS, SUSE) and Archs (x86_64 and aarch64)
# and have consistent docker-ce version, like: 18.06, 18.09
curl -fsSL https://get.docker.com -o get-docker.sh
# Install docker ce.
if [[ "{{ docker_version }}" == "latest" ]]; then
sh get-docker.sh
else
VERSION="{{ docker_version }}" sh get-docker.sh
fi
# Stopping firewall and allow all traffic
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Restart docker.
systemctl daemon-reload
systemctl restart docker
executable: /bin/bash
14 changes: 7 additions & 7 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@
- Category:Cloud
- Project:docker/machine
- Application:Docker Machine@v0.16.1
- Application:Docker@latest-release
- Application:Docker@18.06
- Application:Go@1.12.1
- Application:OpenStack@mitaka
- OS:ubuntu-trusty
Expand Down Expand Up @@ -1374,7 +1374,7 @@
- Project:docker/machine
- Application:Docker Machine@v0.16.1
- Application:OpenStack@newton
- Application:Docker@latest-release
- Application:Docker@18.06
- Application:Go@1.12.1
- OS:ubuntu-xenial
- Arch:x86_64
Expand All @@ -1401,7 +1401,7 @@
- Project:docker/machine
- Application:Docker Machine@v0.16.1
- Application:OpenStack@ocata
- Application:Docker@latest-release
- Application:Docker@18.06
- Application:Go@1.12.1
- OS:ubuntu-xenial
- Arch:x86_64
Expand All @@ -1428,7 +1428,7 @@
- Project:docker/machine
- Application:Docker Machine@v0.16.1
- Application:OpenStack@pike
- Application:Docker@latest-release
- Application:Docker@18.06
- Application:Go@1.12.1
- OS:ubuntu-xenial
- Arch:x86_64
Expand All @@ -1455,7 +1455,7 @@
- Project:docker/machine
- Application:Docker Machine@v0.16.1
- Application:OpenStack@queens
- Application:Docker@latest-release
- Application:Docker@18.06
- Application:Go@1.12.1
- OS:ubuntu-xenial
- Arch:x86_64
Expand All @@ -1482,7 +1482,7 @@
- Project:docker/machine
- Application:Docker Machine@v0.16.1
- Application:OpenStack@rocky
- Application:Docker@latest-release
- Application:Docker@18.06
- Application:Go@1.12.1
- OS:ubuntu-xenial
- Arch:x86_64
Expand All @@ -1509,7 +1509,7 @@
- Project:docker/machine
- Application:Docker Machine@v0.16.1
- Application:OpenStack@stein
- Application:Docker@latest-release
- Application:Docker@18.06
- Application:Go@1.12.1
- OS:ubuntu-xenial
- Arch:x86_64
Expand Down

0 comments on commit 5d90f8f

Please sign in to comment.