5 echo "__rancher_ip_addr__" > /opt/config/rancher_ip_addr.txt
7 echo $HOST_IP `hostname` >> /etc/hosts
10 if [ ! -z "__docker_proxy__" ]; then
11 cat > /etc/docker/daemon.json <<EOF
13 "insecure-registries" : ["__docker_proxy__"]
17 if [ ! -z "__apt_proxy__" ]; then
18 cat > /etc/apt/apt.conf.d/30proxy<<EOF
19 Acquire::http { Proxy "http://__apt_proxy__"; };
20 Acquire::https::Proxy "DIRECT";
25 mkdir -p /dockerdata-nfs
26 echo "__rancher_ip_addr__:/dockerdata-nfs /dockerdata-nfs nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0" | tee -a /etc/fstab
28 apt-get -y install linux-image-extra-$(uname -r) jq nfs-common
32 # install docker 17.03
33 curl -s https://releases.rancher.com/install-docker/17.03.sh | sh
34 usermod -aG docker ubuntu
36 # Fix virtual memory allocation for onap-log:elasticsearch:
37 echo "vm.max_map_count=262144" >> /etc/sysctl.conf
42 while [ ! -e /dockerdata-nfs/rancher_agent_cmd.sh ]; do
46 cp /dockerdata-nfs/rancher_agent_cmd.sh .
47 sed -i "s/docker run/docker run -e CATTLE_AGENT_IP=${HOST_IP}/g" rancher_agent_cmd.sh
48 source rancher_agent_cmd.sh