Skip to content

Commit

Permalink
Update user-data examples
Browse files Browse the repository at this point in the history
With #2, dhcpcd is masked in the image, so no need to stop and disable
it in bootcmd anymore.
  • Loading branch information
timebertt committed May 10, 2021
1 parent de13b38 commit 755807d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.img
*.zip
/.vagrant
.idea
8 changes: 2 additions & 6 deletions examples/k3s-cluster/raspberry-0/user-data.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#cloud-config

hostname: raspberry-0
# update /etc/hosts according to hostname (otherwise sudo will complain)
manage_etc_hosts: true
locale: en_US.UTF-8
timezone: Europe/Berlin

Expand All @@ -22,8 +24,6 @@ users:
ssh_pwauth: false

bootcmd:
# disable dhcpcd so it doesn't interfere with our static IP config
- systemctl disable dhcpcd && systemctl stop dhcpcd
# disable ipv6 on all interfaces
- sysctl net.ipv6.conf.all.disable_ipv6=1

Expand Down Expand Up @@ -166,7 +166,3 @@ write_files:
image:
repository: metallb/speaker
tag: v0.9.5
runcmd:
# fix /etc/hosts entry for hostname, otherwise sudo will complain
- sed -i "s/raspberrypi/$(hostname)/" /etc/hosts
8 changes: 2 additions & 6 deletions examples/k3s-cluster/raspberry-1/user-data.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#cloud-config

hostname: raspberry-1
# update /etc/hosts according to hostname (otherwise sudo will complain)
manage_etc_hosts: true
locale: en_US.UTF-8
timezone: Europe/Berlin

Expand All @@ -22,8 +24,6 @@ users:
ssh_pwauth: false

bootcmd:
# disable dhcpcd so it doesn't interfere with our static IP config
- systemctl disable dhcpcd && systemctl stop dhcpcd
# disable ipv6 on all interfaces
- sysctl net.ipv6.conf.all.disable_ipv6=1

Expand Down Expand Up @@ -163,7 +163,3 @@ write_files:
image:
repository: metallb/speaker
tag: v0.9.5
runcmd:
# fix /etc/hosts entry for hostname, otherwise sudo will complain
- sed -i "s/raspberrypi/$(hostname)/" /etc/hosts
6 changes: 2 additions & 4 deletions examples/simple/user-data.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#cloud-config

hostname: raspberry-0
# update /etc/hosts according to hostname (otherwise sudo will complain)
manage_etc_hosts: true
locale: en_US.UTF-8
timezone: Europe/Berlin

Expand Down Expand Up @@ -40,7 +42,3 @@ ssh_pwauth: false
# #!/bin/bash
# echo "Hello cloud-init on Raspberry Pi!"
# date > /tmp/per-once-was-here

runcmd:
# fix /etc/hosts entry for hostname, otherwise sudo will complain
- sed -i "s/raspberrypi/$(hostname)/" /etc/hosts
8 changes: 2 additions & 6 deletions examples/static-ip/user-data.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#cloud-config

hostname: raspberry-0
# update /etc/hosts according to hostname (otherwise sudo will complain)
manage_etc_hosts: true
locale: en_US.UTF-8
timezone: Europe/Berlin

Expand All @@ -24,11 +26,5 @@ users:
ssh_pwauth: false

bootcmd:
# disable dhcpcd so it doesn't interfere with our static IP config
- systemctl disable dhcpcd && systemctl stop dhcpcd
# disable ipv6 on all interfaces
- sysctl net.ipv6.conf.all.disable_ipv6=1

runcmd:
# fix /etc/hosts entry for hostname, otherwise sudo will complain
- sed -i "s/raspberrypi/$(hostname)/" /etc/hosts
9 changes: 2 additions & 7 deletions user-data.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#cloud-config

hostname: raspberry-0
# update /etc/hosts according to hostname (otherwise sudo will complain)
manage_etc_hosts: true
locale: en_US.UTF-8
timezone: Europe/Berlin

Expand Down Expand Up @@ -28,8 +30,6 @@ users:
ssh_pwauth: false

bootcmd:
# disable dhcpcd so it doesn't interfere with our static IP config
- systemctl disable dhcpcd && systemctl stop dhcpcd
# disable ipv6 on all interfaces
- sysctl net.ipv6.conf.all.disable_ipv6=1

Expand All @@ -46,8 +46,3 @@ write_files:
#!/bin/bash
echo "Hello cloud-init on Raspberry Pi!"
date > /tmp/per-once-was-here
runcmd:
# fix /etc/hosts entry for hostname, otherwise sudo will complain
- sed -i "s/raspberrypi/$(hostname)/" /etc/hosts

0 comments on commit 755807d

Please sign in to comment.