#cloud-config

hostname: core-elb-1
ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwMm60Iu541aUsjkq3lUEJbJx3gLiaWXNynEm686WLVTsD/fQoPOKZKhvQtE7m9vSyDHxcI6zXvgfkQs9bsYN2S5yJPjuEnPnhROr8ulkI2vz4ffYm80pmZdvshunqrLSRYJYCK+BTqQ423r6GOLAKZfKuprfB61iWgVn79/D+QDHo1UBL4/8mPRDGHx6rv1J+vBkGhQeyPkHon9IzH5T/88M/nio3yET2J+b3+csuhsTi4RtXpYoQfKHouceNZGL9rkTXyezIUWMOlMh4EabOyhZHOqAHxLyaBSMOuRL14WJF2Q7MkTMqp8JFlkSCEQpKAx82jEevRcBwfkGhdG5SQ== rgarcia@Robs-Mac-Pro.local
  - ssh-rsa %XSCONTAINERRSAPUB%
users:
  - name: "rgarcia"
    groups:
      - "sudo"
      - "docker"
    ssh-authorized-keys:
      - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwMm60Iu541aUsjkq3lUEJbJx3gLiaWXNynEm686WLVTsD/fQoPOKZKhvQtE7m9vSyDHxcI6zXvgfkQs9bsYN2S5yJPjuEnPnhROr8ulkI2vz4ffYm80pmZdvshunqrLSRYJYCK+BTqQ423r6GOLAKZfKuprfB61iWgVn79/D+QDHo1UBL4/8mPRDGHx6rv1J+vBkGhQeyPkHon9IzH5T/88M/nio3yET2J+b3+csuhsTi4RtXpYoQfKHouceNZGL9rkTXyezIUWMOlMh4EabOyhZHOqAHxLyaBSMOuRL14WJF2Q7MkTMqp8JFlkSCEQpKAx82jEevRcBwfkGhdG5SQ== rgarcia@Robs-Mac-Pro.local
users:
  - name: "root"
    ssh-authorized-keys:
      - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwMm60Iu541aUsjkq3lUEJbJx3gLiaWXNynEm686WLVTsD/fQoPOKZKhvQtE7m9vSyDHxcI6zXvgfkQs9bsYN2S5yJPjuEnPnhROr8ulkI2vz4ffYm80pmZdvshunqrLSRYJYCK+BTqQ423r6GOLAKZfKuprfB61iWgVn79/D+QDHo1UBL4/8mPRDGHx6rv1J+vBkGhQeyPkHon9IzH5T/88M/nio3yET2J+b3+csuhsTi4RtXpYoQfKHouceNZGL9rkTXyezIUWMOlMh4EabOyhZHOqAHxLyaBSMOuRL14WJF2Q7MkTMqp8JFlkSCEQpKAx82jEevRcBwfkGhdG5SQ== rgarcia@Robs-Mac-Pro.local

coreos:
  etcd2:
      name: core-elb-1
      #generate a new token for each unique cluster from https://discovery.etcd.io/new
      # discovery: https://discovery.etcd.io/0a6a07e579d828c738bd3f8405d31742
      # multi-region and multi-cloud deployments need to use $public_ipv4
      advertise-client-urls: "http://10.0.2.16:2379"
      initial-advertise-peer-urls: "http://10.0.2.16:2380"
      # listen on both the official ports and the legacy ports
      # legacy ports can be omitted if your application doesn't depend on them
      initial-cluster: "core-elb-1=http://10.0.2.16:2380,core-elb-2=http://10.0.2.17:2380,core-prd-1=http://10.0.2.61:2380,core-prd-2=http://10.0.2.62:2380,core-prd-3=http://10.0.2.63:2380,core-prd-4=http://10.0.2.64:2380"
      initial-cluster-state: "existing"
      listen-client-urls: "http://0.0.0.0:2379"
      listen-peer-urls: "http://10.0.2.16:2380"
  fleet:
      public-ip: "10.0.2.16"
      metadata: "name=core-elb-1,disk=magnetic,type=essential"

  units:
    - name: etcd2.service
      command: start
    - name: fleet.service
      command: start
    - name: flanneld.service
      drop-ins:
      - name: 50-network-config.conf
        content: |
          [Service]
          ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }'
      command: start
    - name: sshd.socket
      runtime: true
      command: restart
      content: |
        [Socket]
        ListenStream=2222
        Accept=yes
    - name: media-fs1.mount
      command: start
      content: |
        Description=Mount FS1 for persistant storage
        Before=docker.service
        [Mount]
        What=fs1.bighead.net:/data/dock-vols
        Where=/media/fs1
        Type=nfs
        Options=vers=3,rsize=32768,wsize=32768,intr,noatime,exec
    - name: media-fs2.mount
      command: start
      content: |
        Description=Mount FS2 for persistant storage
        Before=docker.service
        [Mount]
        What=fs2.bighead.net:/data/dock-vols
        Where=/media/fs2
        Type=nfs
        Options=vers=3,rsize=32768,wsize=32768,intr,noatime,exec
    - name: docker-tcp.socket
      command: start
      enable: true
      content: |
        [Unit]
        Description=Docker Socket for the API

        [Socket]
        ListenStream=2375
        BindIPv6Only=both
        Service=docker.service

        [Install]
        WantedBy=sockets.target

write_files:
  - path: /etc/environment
    permissions: 0644
    content: |
      COREOS_PRIVATE_IPV4=10.0.2.16
      COREOS_PUBLIC_IPV4=12.13.85.210
  - path: /root/.docker/config.json
    owner: root:root
    permissions: '0644'
    content: |
        {
        	"auths": {
        		"docker.bighead.net:5000": {
        			"auth": "cmdhcmNpYTptb3dnbGk3MTk5",
        			"email": "rgarcia@bighead.net"
        		}
        	}
        }
  - path: /home/core/.docker/config.json
    owner: core:core
    permissions: '0644'
    content: |
        {
        	"auths": {
        		"docker.bighead.net:5000": {
        			"auth": "cmdhcmNpYTptb3dnbGk3MTk5",
        			"email": "rgarcia@bighead.net"
        		}
        	}
        }

# Template loaded from /usr/lib/python2.4/site-packages/xscontainer/data/cloud-config.template
