Skip to content

Instantly share code, notes, and snippets.

@charlesmarshall
Created June 9, 2014 09:15
Show Gist options
  • Save charlesmarshall/2c15fdbbd3f7200f06b9 to your computer and use it in GitHub Desktop.
Save charlesmarshall/2c15fdbbd3f7200f06b9 to your computer and use it in GitHub Desktop.
CoreOS Cloud-Init with amends to environment file
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB ...snip... QAyapHGwoBvkq7nNp
coreos:
etcd:
# via https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/7028e012ca66ef0121b64c19c40a425a
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
runtime: no
content: |
[Unit]
Description=fleet
[Service]
Environment=FLEET_PUBLIC_IP=$private_ipv4
ExecStart=/usr/bin/fleet
- name: envsetup.service
runtime: no
command: start
content: |
[Unit]
Description=Append details to default env
[Service]
ExecStart=/bin/bash -c "echo \"$(cat /etc/environment | sed -r 's#source /etc/environment_extras ; ##gi') \nsource /etc/environment_extras ; \" > /etc/environment ; echo \"$(cat /etc/environment | sed -r 's#source /etc/environment_boot ; ##gi') \nsource /etc/environment_boot ; \" > /etc/environment ; "
[X-Fleet]
X-Conflicts=envsetup.service
write_files:
- content: |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB ...snip... QAyapHGwoBvkq7nNp
path: /home/core/.ssh/shared.pub
permissions: '0600'
owner: core:core
- content: |
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAsjvCcWeXSpB2EvTvxsyMHoA55BDcU/oP0Kr1QvgXGmw/PT/R
8Nq/Hy8WBW8vlJGqlkClZqvJn7vE014G3a4otmJT087nA+ftfYc0g04GzBFzt05Q
... snip ...
dWtYdrxBBuKUDmSqdHkGPJS/KErmVm2OWqPgiOMgae2s7QSrySX6VKRH/grV0DLh
UYrPiHUruKX6rgEVjhzS55dKiN4XRk0N+CWYXq3mgmO5zV3rb4/u
-----END RSA PRIVATE KEY-----
path: /home/core/.ssh/shared
permissions: '0600'
owner: core:core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment