Skip to content

Instantly share code, notes, and snippets.

@PrplHaz4

PrplHaz4/cloud-config.yml

Last active Sep 9, 2019
Embed
What would you like to do?
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