Last active
October 24, 2022 10:02
-
-
Save janeczku/2baa0db0b89913999eb05ddb6f343f9a to your computer and use it in GitHub Desktop.
Example RancherOS configuration
This file contains hidden or 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 | |
hostname: host-0815 | |
ssh_authorized_keys: | |
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA61LSHA7iU+82Z2qypYLx2gB9uHydUOoDON30ceAKl5dSgzShtF5XS5sqABYBMowDcvdkNyUDdt1Druv82iu/scATLFmxTQ8R2XIL33dMO6IpBg0d3WQcU5Xqeor9s5LTpln7F0V+9vaYG/nXqQtnz4PEnZGA+f9ddHuvcDajqKLNTDyriL87E6HAfjNU+1ShI2Qv8Zqhq8rYW0zkn2C+4vVKpgzq8B91R7hSXZwUTU9+bIq3uqTfe/t9/5hFNZEUo/ezV25DFvWDmvKcXt1QRoLxL/NI7h00fEJY7QVh2eevtiA9BdthI2LHx2tm2LoMYHQVZUVljm033xh2UISx | |
runcmd: | |
- echo "true" > /home/rancher/provisioned | |
write_files: | |
- path: /etc/docker/certs.d/private-registry.internal/ca.crt | |
permissions: "0644" | |
owner: root | |
content: | | |
-----BEGIN CERTIFICATE----- | |
MIICKzCCAdWgAwIBAgIJAIMGUj8Nj8nNMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV | |
BAYTAkRFMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX | |
aWRnaXRzIFB0eSBMdGQwHhcNMTgxMTI4MTg0OTUwWhcNMjAxMTI3MTg0OTUwWjBF | |
MQswCQYDVQQGEwJERTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 | |
ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALL7 | |
789lpQLardPKcuFGAWE9+NwEqjogccYCNzTHVEeuaTfkzUEQkwfc2CdpLDjimeTd | |
mZlBlAC89PDRpQlLd7ECAwEAAaOBpzCBpDAdBgNVHQ4EFgQUhR930x7NxpBnUucH | |
MXNbJgwLno8wdQYDVR0jBG4wbIAUhR930x7NxpBnUucHMXNbJgwLno+hSaRHMEUx | |
CzAJBgNVBAYTAkRFMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRl | |
cm5ldCBXaWRnaXRzIFB0eSBMdGSCCQCDBlI/DY/JzTAMBgNVHRMEBTADAQH/MA0G | |
CSqGSIb3DQEBBQUAA0EAoKHUppdUCyrMZLRJsrm/pnLq5WqFysT39976/vQvOiP6 | |
+23OO/Qf3vJZo59MEE2B3hJl0UfkNXobQyDun9gySw== | |
-----END CERTIFICATE----- | |
mounts: | |
# Mount NFS4 share | |
# Note: Mount paths for nfs/nfs4 mounts are created automatically. | |
- ["<nfs_4_server_ip>:/", "/mnt/nfs", "nfs4", "<optional mount options>"] | |
# Note: If disk is not pre-formatted, use `runcmd` cloud-config directive to create filesystem | |
# Note: Mount path needs to exist. Use `runcmd` to create if necessary. | |
- ["/dev/nvme0n1p1","/mnt/data","ext4","<optional mount options>"] | |
rancher: | |
network: | |
dns: | |
nameservers: | |
- 1.1.1.1 | |
- 1.0.0.1 | |
override: true # Override DHCP assigned nameservers | |
interfaces: | |
eth0: | |
dhcp: true | |
eth1: | |
dhcp: false | |
address: 172.68.1.100/24 | |
gateway: 172.68.1.1 | |
mtu: 1500 | |
vlans: 100 | |
services: | |
custom-service: | |
image: nginx | |
ports: | |
- "80:80" | |
labels: | |
io.rancher.os.scope: system # Remove to run in User Docker | |
docker: | |
registry_mirror: "https://mirror.gcr.io" | |
extra_args: ['--bip=172.20.0.1/16','--fixed-cidr=172.20.0.0/17'] | |
engine: docker-17.03.2-ce | |
system_docker: | |
# Configure registry mirror (pull through cache) for System Docker | |
# Ref: https://docs.docker.com/registry/recipes/mirror/ | |
registry_mirror: "http://10.10.10.23:5555" | |
sysctl: | |
vm.max_map_count: 262144 | |
registry_auths: | |
https://index.docker.io/v1/: | |
username: me | |
password: secret |
Hi, just wondering, what is the meaning from echo "true" > /home/rancher/provisioned"
Thanks
That creates a file at /home/rancher/provisioned
with the text true
inside.
Thanks, helped me! :-) @Rancher-v1.5.5
Hi, just wondering, what is the meaning from echo "true" > /home/rancher/provisioned"
Thanks
It's just an example of using runcmd
:-)
A lot more examples are here: https://gist.github.com/janeczku/02302dae3fbfa011f4f7a60df2b5f24e
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, just wondering, what is the meaning from echo "true" > /home/rancher/provisioned"
Thanks