Created
April 9, 2016 16:20
-
-
Save mies/1b27a60cba06e26112494a874dd37fb9 to your computer and use it in GitHub Desktop.
Droplet anchor IP configuration for CoreOS cloud-config on Digital Ocean
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: | |
units: | |
# Explicit anchor IP configuration required on CoreOS stable droplet. | |
# <https://www.digitalocean.com/community/tutorials/how-to-enable-floating-ips-on-an-older-droplet> | |
- name: droplet-anchor-ip.service | |
command: start | |
content: | | |
[Unit] | |
Description=Droplet anchor IP | |
[Service] | |
Type=oneshot | |
RemainAfterExit=true | |
ExecStart=/usr/bin/sh -c "anchor_ipv4=$(curl --silent http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address); ip addr | grep --silent $${anchor_ipv4} || ip addr add $${anchor_ipv4}/16 dev eth0" | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment