Use docker-cmd hook.
[apex-tripleo-heat-templates.git] / docker / firstboot / start_docker_agents.sh
index bb458a6..cb8b2a5 100644 (file)
@@ -23,7 +23,7 @@ Restart=on-failure
 ExecStartPre=-/usr/bin/docker kill heat-agents
 ExecStartPre=-/usr/bin/docker rm heat-agents
 ExecStartPre=/usr/bin/docker pull $agent_image
-ExecStart=/usr/bin/docker run --name heat-agents --privileged --net=host -v /var/lib/etc-data:/var/lib/etc-data -v /run:/run -v /etc:/host/etc -v /usr/bin/atomic:/usr/bin/atomic -v /var/lib/dhclient:/var/lib/dhclient -v /var/lib/cloud:/var/lib/cloud -v /var/lib/heat-cfntools:/var/lib/heat-cfntools --entrypoint=/usr/bin/os-collect-config $agent_image
+ExecStart=/usr/bin/docker run --name heat-agents --privileged --net=host -v /var/lib/etc-data:/var/lib/etc-data -v /run:/run -v /etc:/host/etc -v /usr/bin/atomic:/usr/bin/atomic -v /var/lib/dhclient:/var/lib/dhclient -v /var/lib/cloud:/var/lib/cloud -v /var/lib/heat-cfntools:/var/lib/heat-cfntools -v /usr/bin/docker:/usr/bin/docker --entrypoint=/usr/bin/os-collect-config $agent_image
 ExecStop=/usr/bin/docker stop heat-agents
 
 [Install]
@@ -48,23 +48,13 @@ fi
 /sbin/setenforce 0
 /sbin/modprobe ebtables
 
+# CentOS sets ptmx to 000. Withoutit being 666, we can't use Cinder volumes
+chmod 666 /dev/pts/ptmx
+
 # We need hostname -f to return in a centos container for the puppet hook
 HOSTNAME=$(hostname)
 echo "127.0.0.1 $HOSTNAME.localdomain $HOSTNAME" >> /etc/hosts
 
-# Another hack.. we need a different docker version
-# (should obviously be dropped once the atomic image contains docker 1.8.2)
-/usr/bin/systemctl stop docker.service
-/bin/curl -o /tmp/docker https://get.docker.com/builds/Linux/x86_64/docker-1.8.2
-/bin/mount -o remount,rw /usr
-/bin/rm /bin/docker
-/bin/cp /tmp/docker /bin/docker
-/bin/chmod 755 /bin/docker
-
-# enable and start docker
-/usr/bin/systemctl enable docker.service
-/usr/bin/systemctl restart --no-block docker.service
-
 # enable and start heat-docker-agents
 chmod 0640 /etc/systemd/system/heat-docker-agents.service
 /usr/bin/systemctl enable heat-docker-agents.service