Skip to content

Instantly share code, notes, and snippets.

@danehans
Forked from larsks/inventory
Last active February 17, 2016 20:01
Show Gist options
  • Save danehans/fb819e06a9f272177d69 to your computer and use it in GitHub Desktop.
Save danehans/fb819e06a9f272177d69 to your computer and use it in GitHub Desktop.
TASK: [etcd | Enable etcd] ****************************************************
failed: [core-node02.ctocllab.cisco.com] => {"failed": true}
msg: no service or tool found for: etcd2
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/root/cluster.retry
core-node02.ctocllab.cisco.com : ok=34 changed=4 unreachable=0 failed=1
- name: Enable etcd
service: name={{ etcd_svc_name }} enabled=yes
- name: Start etcd
service: name={{ etcd_svc_name }} state=started
register: etcd_started
$ systemctl status etcd
● etcd.service - etcd
Loaded: loaded (/usr/lib64/systemd/system/etcd.service; static; vendor preset: disabled)
Active: inactive (dead)
# Account name of remote user. Ansible will use this user account to ssh into
# the managed machines. The user must be able to use sudo without asking
# for password unless ansible_sudo_pass is set
ansible_ssh_user: core
# Required for CoreOS
# https://coreos.com/blog/managing-coreos-with-ansible.html
ansible_python_interpreter: "PATH=/opt/bin/:$PATH python"
[masters]
core-node02.ctocllab.cisco.com
[etcd]
core-node02.ctocllab.cisco.com
[nodes]
core-node02.ctocllab.cisco.com
#!/bin/bash
# Create the directories used for Docker bind mounting
mkdir -p /opt/bin/
mkdir -p /tmp/.ansible/files
mkdir -p /etc/etcd
mkdir -p /etc/systemd/system
mkdir -p /usr/lib64/systemd/system
# Create the Python binary
cat > /opt/bin/python <<EOF
#!/bin/sh
tty > /dev/null 2>&1 && ttyflag='-t'
exec docker run -i --rm -v /opt/bin:/opt/bin \
-v /etc/lsb-release:/etc/lsb-release \
-v /etc/etcd/:/etc/etcd \
-v /etc/systemd/system:/etc/systemd/system \
-v /usr/lib64/systemd/system:/usr/lib64/systemd/system \
-v /home/core:/home/core -v /tmp/.ansible/files:/tmp/.ansible/files \
\$ttyflag --net=host python:2.7.11-alpine python "\$@"
EOF
sudo chmod +x /opt/bin/python
@larsks
Copy link

larsks commented Feb 17, 2016

You're starting the container with --net=none, so you wouldn't expect wget or anything else that requires the network to work...

@danehans
Copy link
Author

Roger that. I figured it out as I was falling asleep last night. I think my brain was fried :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment