User Tools

Site Tools


ubuntu:pi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:pi [2021-01-25 23:36] – changed name of playbook gabrielubuntu:pi [2021-02-08 16:27] (current) – [Configuring RTC on Ubuntu 20.04 LTS] formatting gabriel
Line 47: Line 47:
  
 <code> <code>
 +# disable the unattended upgrades service (you can re-enable later if you prefer)
 systemctl disable unattended-upgrades systemctl disable unattended-upgrades
 +
 +# install python for Ansible
 apt install python apt install python
 +
 +# set editor to Vim (optional)
 update-alternatives --config editor update-alternatives --config editor
 +
 +# set a hostname
 echo "$MYHOSTNAME" > /etc/hostname echo "$MYHOSTNAME" > /etc/hostname
 +
 # don't forget to update /etc/hosts # don't forget to update /etc/hosts
 </code> </code>
Line 64: Line 72:
         eth0:         eth0:
             addresses:             addresses:
-                - 10.1.2.1/24+                - 10.1.2.3/24
             gateway4: 10.1.2.1             gateway4: 10.1.2.1
             link-local: [ ]             link-local: [ ]
Line 70: Line 78:
                 search: [subnet.quay.net, quay.net]                 search: [subnet.quay.net, quay.net]
                 addresses:                 addresses:
-                    - 10.1.2.3+                    - 10.1.2.53
 </code> </code>
  
-To test this:+Test netplan configuration:
  
 <code> <code>
 netplan try netplan try
 +
 # if that works, remove any other config files and run: # if that works, remove any other config files and run:
 netplay apply netplay apply
 +
 +# once successfully tested you should also remove the default config from cloud-init
 +# (add to Ansible playbook in future)
 +rm -f /etc/netplan/50-cloud-init.yaml
 </code> </code>
  
-==== Ansible plays ====+==== Ansible playbooks ====
  
 <code> <code>
 +# 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 ansible-playbook -l raspi.in.quay.net raspi_ubuntu.yml
-ansible-playbook -l raspi.in.quay.net chrony.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
 </code> </code>
  
 Add the following to Ansible plays in the future: Add the following to Ansible plays in the future:
  
-  * dpkg-reconfigure tzdata 
   * default editor   * default editor
   * prune packages   * prune packages
-  * sshd config 
-  * disable ubuntu account or remove 
   * configre motd   * configre motd
   * apt install lm-sensors   * apt install lm-sensors
-  * update sshd keys 
  
 ===== 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 ====
 +
 +<code>
 +# 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 "dtoverlay=i2c-rtc,$RTCMODEL" >> /boot/firmware/usercfg.txt 
 +
 +# show I2C bus config
 +#  - 68 = hardware detected
 +#  - UU = dtoverlay configured correctly and driver is loaded
 +i2cdetect -y 1
 +</code>
 +
 +//Reference: [[https://pimylifeup.com/raspberry-pi-rtc/|Raspberry Pi RTC: Adding a Real Time Clock//
  
 ===== Reference ===== ===== Reference =====
ubuntu/pi.1611635773.txt.gz · Last modified: 2021-01-25 23:36 by gabriel