ubuntu:pi
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ubuntu:pi [2021-01-23 16:09] – line wrap gabriel | ubuntu:pi [2021-02-08 16:27] (current) – [Configuring RTC on Ubuntu 20.04 LTS] formatting gabriel | ||
---|---|---|---|
Line 38: | Line 38: | ||
# optional: remove cloud-init completely | # optional: remove cloud-init completely | ||
apt-get purge cloud-init | apt-get purge cloud-init | ||
- | rm -rf / | ||
# if you do not remove cloud-init be sure not to allow your | # if you do not remove cloud-init be sure not to allow your | ||
# configuration to be overwritten in future updates to the package | # configuration to be overwritten in future updates to the package | ||
</ | </ | ||
- | Make sure not to overwrite | + | Another option is to create a small 1Mb partition after your root partition to ensure that it can never be grown into the empty space on your SD card. |
Next do the following: | Next do the following: | ||
- | * set hostname | + | < |
- | * Install python for Ansible | + | # disable the unattended upgrades service (you can re-enable later if you prefer) |
- | * configure / | + | systemctl disable unattended-upgrades |
- | * run ubuntu_ansible_control.yml playbook to update to most recent profile | + | |
+ | # install python for Ansible | ||
+ | apt install python | ||
- | Add the following | + | # set editor |
+ | update-alternatives --config editor | ||
- | * disable ipv6 | + | # set a hostname |
- | * timezone | + | echo " |
- | * default editor | + | |
- | * prune packages | + | |
- | * sshd config | + | |
- | * disable ubuntu account or remove | + | |
- | * configre motd | + | |
+ | # don't forget to update /etc/hosts | ||
+ | </ | ||
+ | |||
+ | Configure network interface for static use: | ||
+ | |||
+ | < | ||
+ | # / | ||
+ | network: | ||
+ | version: 2 | ||
+ | renderer: networkd | ||
+ | ethernets: | ||
+ | eth0: | ||
+ | addresses: | ||
+ | - 10.1.2.3/24 | ||
+ | gateway4: 10.1.2.1 | ||
+ | link-local: [ ] | ||
+ | nameservers: | ||
+ | search: [subnet.quay.net, | ||
+ | addresses: | ||
+ | - 10.1.2.53 | ||
+ | </ | ||
+ | |||
+ | Test netplan configuration: | ||
+ | |||
+ | < | ||
+ | netplan try | ||
+ | |||
+ | # if that works, remove any other config files and run: | ||
+ | netplay apply | ||
+ | |||
+ | # once successfully tested you should also remove the default config from cloud-init | ||
+ | # (add to Ansible playbook in future) | ||
+ | rm -f / | ||
+ | </ | ||
+ | |||
+ | ==== Ansible playbooks ==== | ||
+ | |||
+ | < | ||
+ | # standard configuration for all Raspberry Pi systems | ||
+ | # this playbook does the following: | ||
+ | # - base configurations (raspi_ubuntu) | ||
+ | # - time service config (chrony) | ||
+ | # - firewall config (nftables) | ||
+ | ansible-playbook -l raspi.in.quay.net raspi_ubuntu.yml | ||
+ | |||
+ | # regenerate SSHD keys on host after build | ||
+ | # NOTE: Ubuntu ships with a default set of SSHD keys | ||
+ | ansible-playbook -l raspi.in.quay.net regen_sshd_keys.yml | ||
+ | </ | ||
+ | |||
+ | Add the following to Ansible plays in the future: | ||
+ | |||
+ | * default editor | ||
+ | * prune packages | ||
+ | * configre motd | ||
+ | * apt install lm-sensors | ||
===== Hardware notes ===== | ===== Hardware notes ===== | ||
Quick reference for Raspberry Pi hardware tools on Ubuntu. | Quick reference for Raspberry Pi hardware tools on Ubuntu. | ||
+ | |||
+ | ==== Configuring RTC on Ubuntu 20.04 LTS ==== | ||
+ | |||
+ | < | ||
+ | # Install the I2C tools to access the bus and configure your RTC | ||
+ | apt install i2c-tools | ||
+ | |||
+ | # Enable your RTC in the Pi boot config | ||
+ | RTCMODEL=ds3231 | ||
+ | echo " | ||
+ | |||
+ | # show I2C bus config | ||
+ | # - 68 = hardware detected | ||
+ | # - UU = dtoverlay configured correctly and driver is loaded | ||
+ | i2cdetect -y 1 | ||
+ | </ | ||
+ | |||
+ | // | ||
===== Reference ===== | ===== Reference ===== | ||
Line 76: | Line 145: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |
ubuntu/pi.1611436174.txt.gz · Last modified: 2021-01-23 16:09 by gabriel