Skip to content

Instantly share code, notes, and snippets.

@mikebell
Last active April 19, 2020 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebell/9dda588d45f4314c313665d73f3ab441 to your computer and use it in GitHub Desktop.
Save mikebell/9dda588d45f4314c313665d73f3ab441 to your computer and use it in GitHub Desktop.
ssh_authorized_keys:
- "github:mikebell"
hostname: k30s-master
write_files:
- enconding: ""
content: |-
#!/bin/bash
write_log () {
local message="${1}"
logger -t "run-cmd" "${message}"
echo "${message}"
}
write_log "Getting the service using eth0..."
ETH0=$(connmanctl services | awk '{ print $3 }' | while read -r s1; do connmanctl services $s1 | grep -q "eth0" && echo "$s1"; done)
write_log "eth0 is bound to: ${ETH0}"
write_log "Setting up manual net config..."
connmanctl config $ETH0 --ipv4 manual 192.168.1.250 255.255.255.0 192.168.1.1 --nameservers 1.1.1.1 1.0.0.1
connmanctl config $ETH0 --ipv6 off
write_log "Restarting connman..."
service connman restart
write_log "$(connmanctl services $ETH0)"
write_log "Network setup done."
owner: root:root
path: /etc/run-cmd.sh
permissions: '0755'
run_cmd:
- "/etc/run-cmd.sh"
k3s_args:
- server
- "--disable-agent --no-deploy traefik --no-deploy servicelb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment