Skip to main content

Ansible Installation For Daily Debian Package Updates

utilities system configuration sysadmin

Install
#

Performed on Debian 12 (bookworm)

echo $UBUNTU_CODENAME
wget -O- "https://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=get&search=0x6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367" | sudo gpg --dearmour -o /usr/share/keyrings/ansible-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/ansible-archive-keyring.gpg] http://ppa.launchpad.net/ansible/ansible/ubuntu $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/ansible.list
sudo apt update && sudo apt install ansible
which ansible
ansible --version

Create inventory
#

cd /etc/ansible
sudo nano hosts
ansible-inventory --list -y

Test that hosts are reachable
#

# Confirm fingerprint of each SSH connection when connecting first time
ansible all -m ping 
# Do ssh-copy-id on other servers that failed auto-login check
ssh-copy-id machine1.mylan.net
# Test individual host
ansible machine1.mylan.net -m ping

Create playbook for updating packages
#

---
#apt-upgrade.yml
- hosts: apt
  become: true
  tasks:
  - name: Update and upgrade apt packages
    apt:
      name: "*"
      state: latest
      #upgrade: yes
      update_cache: yes
      cache_valid_time: 86400 #One day
      autoremove: yes
      purge: true

Links #

Related

Pdfcpu Commands For Manipulating Pdf Files
utilities pdf
Install # Download and extract pdfcpu.
Print CSV Files To PDF With Weasyprint
utilities development pdf python css
CSV file converted to PDF, with variable column widths and footers Printing a CSV file as a nicely formatted table is easy if you import it first into a spreadsheet like Microsoft Excel or LibreOffice Calc.
Beyond Passwords: 5 Ways To Prevent Unauthorized Logins
security ssh sysadmin
Hard-to-guess passwords are important to securing your network from intrusion.