Skip to content

Commit

Permalink
[CE-252] Upgrade docker and go for ansible agent
Browse files Browse the repository at this point in the history
Ansible agent currently use docker.io and old go version.
This patch set will remove the use of docker.io. It will
use docker-ce and newer and go 1.9.2 by default. User has
options to simply change configuration files to use
different version of go lang.

Change-Id: Iabf763153ca21675640bc34c34fccbb4d1323747
Signed-off-by: tongliofcary <litong01@us.ibm.com>
  • Loading branch information
tongliofcary committed Jan 28, 2018
1 parent 19f8025 commit 0ea3531
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 30 deletions.
26 changes: 22 additions & 4 deletions src/agent/ansible/roles/env_flanneld/fastinitnode/tasks/apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
shell: uname -m | sed 's|i686|386|' | sed 's|x86_64|amd64|'
register: rawarch

- name: Figuring out the OS release
shell: lsb_release -cs
register: rawrelease

- name: Setup variables
set_fact:
goroot: "/opt/go"
gopath: "/opt/gopath"
arch: "{{ rawarch.stdout}}"
osrelease: "{{ rawrelease.stdout }}"

- name: Ensure gopath exists
file:
Expand All @@ -23,9 +28,22 @@
apt:
name: "{{ item }}"
with_items:
- ['docker.io', 'python-dev', 'python-pip', 'libtool', 'libltdl-dev']
- ['git', 'net-tools', 'netcat-openbsd', 'autoconf', 'automake']
- ['libtool', 'curl', 'make', 'g++', 'unzip', 'build-essential']
- ['python-dev', 'python-pip', 'libtool', 'libltdl-dev', 'apt-transport-https']
- ['git', 'net-tools', 'netcat-openbsd', 'autoconf', 'automake', 'ca-certificates']
- ['libtool', 'curl', 'make', 'g++', 'unzip', 'build-essential', 'software-properties-common']

- name: Add Docker offical GPG key
shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

- name: Add docker-ce repository
apt_repository:
repo: "deb [arch={{ arch }}] https://download.docker.com/linux/ubuntu {{ osrelease }} stable"
state: present

- name: Update apt and Install Docker-ce
apt:
name: docker-ce
update_cache: yes

- name: Install pip and upgrade
pip:
Expand All @@ -47,7 +65,7 @@

- name: Retrive golang binary and unpackage it
unarchive:
src: "https://storage.googleapis.com/golang/go{{ cluster.go_ver }}.linux-{{ arch }}.tar.gz"
src: "{{ cluster.go_repo }}"
dest: "/opt"
remote_src: True

Expand Down
9 changes: 3 additions & 6 deletions src/agent/ansible/vars/aws.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cluster: {
# This variable indicate what IP should be used, only valid values are
# private_ip or public_ip
node_ip: "public_ip",
assign_public_ip: true,

container_network: {
Network: "172.16.0.0/16",
Expand Down Expand Up @@ -63,13 +64,9 @@ cluster: {
flannel_repo: "https://github.com/coreos/flannel/releases/download/v0.7.1/flannel-v0.7.1-linux-amd64.tar.gz",
etcd_repo: "https://github.com/coreos/etcd/releases/download/v3.2.0/etcd-v3.2.0-linux-amd64.tar.gz",
k8s_repo: "https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/linux/amd64/",

go_ver: "1.8.3",
go_repo: "https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz",

# If volume want to be used, specify a size in GB, make volume size 0 if wish
# not to use volume from your cloud
volume_size: 8,

# cloud block device name presented on virtual machines.
block_device_name: "/dev/vdb"
volume_size: 8
}
8 changes: 2 additions & 6 deletions src/agent/ansible/vars/azure.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,9 @@ cluster: {
flannel_repo: "https://github.com/coreos/flannel/releases/download/v0.7.1/flannel-v0.7.1-linux-amd64.tar.gz",
etcd_repo: "https://github.com/coreos/etcd/releases/download/v3.2.0/etcd-v3.2.0-linux-amd64.tar.gz",
k8s_repo: "https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/linux/amd64/",

go_ver: "1.8.3",
go_repo: "https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz",

# If volume want to be used, specify a size in GB, make volume size 0 if wish
# not to use volume from your cloud
volume_size: 8,

# cloud block device name presented on virtual machines.
block_device_name: "/dev/vdb"
volume_size: 8
}
4 changes: 2 additions & 2 deletions src/agent/ansible/vars/bc1st.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ fabric: {
}
},

baseimage_tag: "1.0.5",
baseimage_tag: "1.1.0-preview",
# This tag defines image tag for containers such as kafka, zookeeper and couchdb
helper_tag: "",
helper_tag: "1.1.0-preview",
ca: { admin: "admin", adminpw: "adminpw" }
}
4 changes: 2 additions & 2 deletions src/agent/ansible/vars/bc2nd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ fabric: {
}
},

baseimage_tag: "1.0.5",
baseimage_tag: "1.1.0-preview",
# This tag defines image tag for containers such as kafka, zookeeper and couchdb
helper_tag: "",
helper_tag: "1.1.0-preview",
ca: { admin: "admin", adminpw: "adminpw" }
}
6 changes: 2 additions & 4 deletions src/agent/ansible/vars/os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ cluster: {
flannel_repo: "https://github.com/coreos/flannel/releases/download/v0.7.1/flannel-v0.7.1-linux-amd64.tar.gz",
etcd_repo: "https://github.com/coreos/etcd/releases/download/v3.2.0/etcd-v3.2.0-linux-amd64.tar.gz",
k8s_repo: "https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/linux/amd64/",
go_repo: "https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz",

go_ver: "1.8.3",
# If volume want to be used, specify a size in GB, make volume size 0 if wish
# not to use volume from your cloud
volume_size: 0,
# cloud block device name presented on virtual machines.
block_device_name: "/dev/vdb"
volume_size: 8
}
6 changes: 2 additions & 4 deletions src/agent/ansible/vars/vb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ cluster: {
flannel_repo: "https://github.com/coreos/flannel/releases/download/v0.7.1/flannel-v0.7.1-linux-amd64.tar.gz",
etcd_repo: "https://github.com/coreos/etcd/releases/download/v3.2.0/etcd-v3.2.0-linux-amd64.tar.gz",
k8s_repo: "https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/linux/amd64/",
go_repo: "https://dl.google.com/go/go1.9.3.linux-amd64.tar.gz",

go_ver: "1.8.3",
# If volume want to be used, specify a size in GB, make volume size 0 if wish
# not to use volume from your cloud
volume_size: 0,
# cloud block device name presented on virtual machines.
block_device_name: "/dev/vdb"
volume_size: 8
}
4 changes: 2 additions & 2 deletions src/agent/ansible/vars/vb1st.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ fabric: {
}
},

baseimage_tag: "1.0.5",
baseimage_tag: "1.1.0-preview",
# This tag defines image tag for containers such as kafka, zookeeper and couchdb
helper_tag: "",
helper_tag: "1.1.0-preview",
ca: { admin: "admin", adminpw: "adminpw" }
}

0 comments on commit 0ea3531

Please sign in to comment.