Created
September 24, 2014 18:38
-
-
Save joshuacalloway/d12fc032554e79b47267 to your computer and use it in GitHub Desktop.
user-data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
coreos: | |
update: | |
group: alpha | |
reboot-strategy: best-effort | |
fleet: | |
public-ip: $private_ipv4 | |
metadata: cloud=amazon,type=c3.large,spot=true,disk=64gb,subnet=public_retel,class=shoppertrak | |
etcd: | |
discovery: https://discovery.etcd.io/4c87e9323a7dfe6ceb0412092141ec42 | |
addr: $private_ipv4:4001 | |
peer-addr: $private_ipv4:7001 | |
units: | |
- name: etcd.service | |
command: start | |
- name: fleet.socket | |
enable: yes | |
command: start | |
content: | | |
[Unit] | |
Description=Fleet Socket for the API | |
[Socket] | |
# Talk to the API over a Unix domain socket (default) | |
ListenStream=/var/run/fleet.sock | |
# Talk to the API over an exposed port, uncomment to enable and choose a port | |
#ListenStream= | |
Service=fleet.service | |
[Install] | |
WantedBy=sockets.target | |
- name: fleet.service | |
command: start | |
- name: enable-docker-tcp.service | |
command: start | |
content: | | |
[Unit] | |
Description=Enable the Docker Socket for the API | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/usr/bin/systemctl enable docker-tcp.socket | |
- name: docker-tcp.socket | |
command: start | |
enable: yes | |
content: | | |
[Unit] | |
Description=Docker Socket for the API | |
Before=docker.service | |
[Socket] | |
ListenStream=2375 | |
BindIPv6Only=both | |
Service=docker.service | |
[Install] | |
WantedBy=sockets.target | |
- name: install-fig.service | |
command: start | |
content: | | |
[Unit] | |
After=network-online.target | |
[Service] | |
ExecStart=/usr/bin/mkdir -p /opt/bin | |
ExecStart=/usr/bin/curl -L -o /opt/bin/fig https://github.com/docker/fig/releases/download/0.5.2/linux | |
ExecStart=/usr/bin/chmod +x /opt/bin/fig | |
RemainAfterExit=yes | |
Type=oneshot | |
[Install] | |
WantedBy=multi-user.target | |
- name: login-docker.service | |
command: start | |
content: | | |
[Unit] | |
Description=Logins into docker private repo | |
After=docker.service | |
After=network-online.target | |
[Service] | |
User=core | |
ExecStart=/usr/bin/docker login --username joshuacalloway --password xxyzz --email joshua.calloway@gmail.com | |
Type=oneshot | |
[Install] | |
WantedBy=multi-user.target | |
- name: install-shoppertrak.service | |
runtime: true # Run this service on every reboot of machine | |
command: start | |
content: | | |
[Unit] | |
Description=Installs shoppertrak deploy | |
After=login-docker.service | |
[Service] | |
User=core | |
Type=oneshot | |
ExecStartPre=/usr/bin/docker pull joshuacalloway/shoppertrak-deploy | |
ExecStart=/usr/bin/docker run -e env=dev -v /home/core/shoppertrak:/install joshuacalloway/shoppertrak-deploy | |
[Install] | |
WantedBy=multi-user.target | |
- name: install-nsenter.service | |
command: start | |
content: | | |
[Unit] | |
Description=Installs nsenter ( docker enter ) | |
After=docker.service | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/docker run --rm -v /opt/bin:/target jpetazzo/nsenter | |
- name: download-shoppertrak-images.service | |
command: start | |
content: | | |
[Unit] | |
Description=Downloads shoppertrak images | |
After=install-shoppertrak.service | |
[Service] | |
User=core | |
Type=oneshot | |
ExecStart=/bin/bash -c "/usr/bin/grep 'image:' /home/core/shoppertrak/fig.yml | /usr/bin/awk '{ print $2}' | /usr/bin/sed 's/:\${env}//' | /usr/bin/xargs -n 1 /usr/bin/docker pull" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment