CoreOS, Ansible, OpenStack, and a Private Registry

This took me longer than I want to admit to figure out, so I thought I’d post this solution here.  I’m doing this on Cisco’s OpenStack Private Cloud (COPC) (formerly known as Metacloud).

Problem:  Want to deploy a CoreOS instance that can access docker images from a private registry.  I want to do this with Ansible.

Why its hard:  Not a lot of good documentation on this put in one place.  I kept getting this error:

Really started to aggravate me.

Ansible Playbook

Here’s the playbook in its final glory:

The coreos-cloud-config.yaml file looks like this:

There were a few things to note:

  1. If I used the config_drive: yes like it said on some documentation somewhere with this then I had some problems.
  2. I was using a different configuration for the cloud-config that had me do files instead.  Not sure why I did this, but figured it out by using the other flag.  As you can see I even opened up a problem on CoreOS github repo.   I think this is what you need to do in order to solve your own problems.  And the reason we all need a rubber duck.
  3. The CoreOS documentation shows a IP address range, but I just put in the actual registry for this and it works great.

Hoping that helps someone else not struggle like I did for hours…