Skip to content

Instantly share code, notes, and snippets.

@PrplHaz4
Last active September 9, 2019 20:25
Show Gist options
  • Save PrplHaz4/730473ffc62e364ba1cb0b8b84093a1b to your computer and use it in GitHub Desktop.
Save PrplHaz4/730473ffc62e364ba1cb0b8b84093a1b to your computer and use it in GitHub Desktop.
RancherOS cloud-config.yml samples
# start container-cron after user Docker is started #
# https://github.com/rancher/os/issues/2846
#cloud-config
rancher:
write_files:
- path: /etc/rc.local
permissions: "0755"
owner: root
content: |
#!/bin/bash
wait-for-docker
ros s enable container-cron
ros s up container-cron
# wait for connectivity then mount nfs #
# https://github.com/rancher/os/issues/2606
write_files:
- content: |+
#!/bin/bash
until ping -c1 172.22.100.101 &>/dev/null; do sleep 1; done
mount -t nfs4 172.22.100.101:/ /mnt/nfs
owner: root
path: /etc/rc.local
permissions: "0755"
# wait for dns/dhcp before starting custom service
# https://github.com/rancher/os/issues/2882
write_files:
- path: /etc/rc.local
permissions: "0755"
owner: root
content: |
#!/bin/bash
...
...
## wait dns
while ! nslookup docker.io >/dev/null 2>/dev/null; do
echo "wait for nameserver init"
sleep 1
done
ros s up <service>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment