marcinbojko / linux_mint

Ansible playbook for quick and painless DevOps/SysAdmin workstation, based on Linux Mint 21.x
17 stars 4 forks source link
ansible cloud devops linux linux-mint mint playbook playbooks workstation

Ansible playbook for your DevOps/SysOps Linux Mint 21.x-based workstation

Super-Linter Ansible Lint wakatime

This project is disccontinued. Please use PLD instead. PLD repository is exactly the same as this one but converted into ansible role instead of playbook. This way you can use it in your own playbooks.

Prerequisites

Ansible 2.10 and higher reminder

Assumptions

In-place upgraded OS warning

Role of this playbook is to work on clean or cleanly-upgraded system. I haven't tested it properly in case of in-place upgrade systems, so both 18=>19 and 19=>20 upgrades and playbook usage, are risky and experimental. Make sure all apt repositories (except system ones) are removed from /etc/apt - playbook works best when this list is empty.

Warning - systems after upgrade will require: ansible_python_interpreter=/usr/bin/python3 setting.

Python2 removal

Be aware several packages (virtualbox-6.1, zenmap) will install python2 and remove python-is-python3 package.

sudo apt update
sudo apt install python-is-python3
sudo apt update
sudo apt remove python2 --simulate
sudo apt remove python2

Usage

ansible-playbook ./linux_mint.yaml -i myhost.lst

or change user you're using (startup related stuff will be done for that specific user user)

ansible-playbook ./linux_mint.yaml -i myhost.lst --extra-vars "active_user=myuser"

in case you'd like to run as root with password or ssh key, you can do desktop related changes for user bob

ansible-playbook ./linux_mint.yaml -i myhost.lst --extra-vars "active_user=bob"

or start at specific step

ansible-playbook ../linux_mint.yaml -i myhost.lst --start-at-task="taskname"

or with specific tags

ansible-playbook ../linux_mint.yaml -i myhost.lst --tags "base"

or passing true/false as JSON

ansible-playbook ./linux_mint.yaml -i myhost.lst --extra-vars '{"install_optional": "true"}'

Variables

Most variables are stored in mint19|20.yaml file. If you need extra settings, instead of modyfing it, use custom variable files.

variable default description
install_optional true should optional packages be installed
install_deb true should extra deb packages should be installed
install_flatpak true should flatpak packages be installed
remove_flatpak false should flatpak packages be removed
install_npm true should npm packages be installed
install_vscode_extensions true should we install extra vscode extensions
install_steampipe_plugins true should we install extra steampipe plugins
install_zsh false should we install oh-my-zsh and p10k theme
install_yubico false should we install yubico software
install_state latest if set to latest, every pass of playbook will also update packages
config_ansible true change ansible settings in ansible.cfg
config_dconf true change dconf settings
config_sysctl true change sysctl settings
config_autostart true change application autostart settings
active_user "{{ ansible_ssh_user }}" user for which you're setting folders. By default taken from group_vars
retries_count 4 how many retries
delay_time 15 delay time in seconds between retries
bin_path /usr/local/bin Where to put all downloaded execs
reboot_required false force reboot even if apt upgrade won't change anything
unpack_folder /tmp/linux_mint Which folder to use when downloading and unarchiving

variables for tasks

Are stored in mint21_tasks.yaml

Custom variables, custom variable files

If you don't want to track changes or change main variable file content with every pull, create your own custom variable files. By default playbook will look for files: mint[ansible_distribution_major_version]*.yaml This means - if your distro is Linux Mint 20, place a file in a playbook folder witha name: mint20_custom.yaml If your distro is Linux Mint 21, place a file in a playbook folder with a name: mint21_custom.yaml These filters are added to .gitignore to not override your changes Be careful not to add multiple matching files with corresponding names

Custom file content

custom_repositories: []
custom_keys: []
custom_packages: []

Custom file example

mint20_custom.yaml

custom_repositories:
  # Example
  # - name: google-cloud-sdk
  #   types: deb
  #   suites: cloud-sdk
  #   components: main
  #   uris:
  #     - "https://packages.cloud.google.com/apt"
  #   enabled: true
  #   architectures: amd64
  #   signed_by: https://packages.cloud.google.com/apt/doc/apt-key.gpg
custom_keys:
- https://somekeyfile/key.pgp
custom_packages:
- vlc

Repositories

Repositories: Basic

Repositories: Optional

Packages

Packages: Essential

Packages: Basic (not complete list)

Software Type Link
Amass In-depth Attack Surface Mapping and Asset Discovery https://github.com/OWASP/Amass
AngryIP Scanner Network Scanner https://angryip.org/
Azure CLI Command-line tools for Azure https://github.com/Azure/azure-cli
Balena-etcher Image Writer https://www.balena.io/etcher/
Ctop Container process monitor https://github.com/bcicen/ctop
Diodon Clipboard Manager https://launchpad.net/diodon
Dive Docker image explorer https://github.com/wagoodman/dive
Dockle Container Image Linter for Security https://github.com/goodwithtech/dockle
Double Commander File Manager https://doublecmd.sourceforge.io/
Ffuf Fast web fuzzer written in Go https://github.com/ffuf/ffuf
GitKraken Git Client https://www.gitkraken.com/
Google Chrome Browser https://www.google.com/intl/pl_ALL/chrome/
Google Cloud SDK Command-line tools for GCP https://cloud.google.com/sdk
Google Kubectl/Kubeadm Kubernetes Manager https://kubernetes.io/docs/reference/kubectl/overview/
Gping Ping with a graph https://github.com/orf/gping
Hadolint Docker linter https://github.com/hadolint/hadolint
Helm Package manager for Kubernetes https://helm.sh/
k3d k3d creates containerized k3s clusters https://k3d.io/
k3s Lightweight Kubernetes 5 less than k8s https://k3s.io/
k9s Kubernetes CLI Manager https://github.com/derailed/k9s
Keepass Password Manager https://keepass.info/
Kubeconform Kubernetes config validator https://github.com/yannh/kubeconform
Kubent Kubernetes-no-trouble https://github.com/doitintl/kube-no-trouble
Kubernetes Production-Grade Container Orchestration https://kubernetes.io/
Kustomize Kubernetes customiser https://github.com/kubernetes-sigs/kustomize
Lens Kubernetes IDE https://k8slens.dev/
Minikube Run Kubernetes locally https://github.com/kubernetes/minikube
Packer Image creator https://www.packer.io/
Packetsender Packet Sender can send and receive UDP, TCP, and SSL on the ports of your choosing https://packetsender.com/
Palemoon Browser alternative (Java_+Flash) https://www.palemoon.org/
Polaris Validation of best practices in your Kubernetes clusters https://www.fairwinds.com/polaris
RamboxOS Multi IM https://github.com/TheGoddessInari/hamsket
Rancher Desktop Rancher Desktop runs Kubernetes and container management on your desktop https://rancherdesktop.io/
Redshift Monitor temperature changer http://jonls.dk/redshift/
Remmina Remote Connection Manager https://remmina.org/
Shutter Screenshot Manipulation http://shutter-project.org/
Sops Secrets manager https://github.com/getsops/sops
Synapse Symantic Launcher https://launchpad.net/synapse-project
Tabby Modern Terminal https://github.com/Eugeny/terminus
Teller Secret manager https://github.com/tellerops/teller
Terraform Infrastructure as Code https://www.terraform.io/
Vagrant Unified Workflow https://www.vagrantup.com/
Vault Secrets Manager https://www.vaultproject.io/
VirtualBox Virtualization https://www.virtualbox.org/
Visual Studio Code Code editor https://code.visualstudio.com/
WPS Office for Linux Productivity Tools https://www.wps.com/wps-office-for-linux/
XCA Certificate Manager https://hohnstaedt.de/xca/
Yq YAML processor https://github.com/mikefarah/yq/releases/download/v4.43.1/yq_linux_amd64

Packages: Optional (not complete list)

Software Type Link
Brave Browser Browser alternative https://brave.com/
DockbarX Panel https://github.com/M7S/dockbarx
Enpass Password manager https://www.enpass.io/
GIMP GNU Image Manipulation Program https://www.gimp.org/
Insync Googledrive & Onedrive linux client https://www.insynchq.com/
Kodi Open Source Home Theater https://kodi.tv/
Neofetch A command-line system information tool written in bash 3.2+ https://github.com/dylanaraps/neofetch
Pinta Drawing/Image Editing https://pinta-project.com/pintaproject/pinta/
Spotify Music Player https://www.spotify.com/pl/download/linux/
Steampipe select * from cloud https://steampipe.io/
Sublime Text 3 Text Editor https://www.sublimetext.com/3
Betterbird Email client https://www.betterbird.eu/
Trivy A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI https://github.com/aquasecurity/trivy
Veeam Agent for Linux Backup tool https://www.veeam.com
Veracrypt Source disk encryption https://www.veracrypt.fr/en/Home.html

||||

Packages: Flatpak

Software Type Link
Bitwarden Password Manager Bitwarden
Boxes Virtualization Boxes
Brave Web Browser Brave
EasyEffects Audio Effects Tool EasyEffects
Enpass Password Manager Enpass
Firefox Web Browser Firefox
Flatseal Permissions Manager Flatseal
FreeFileSync File Synchronization FreeFileSync
GIMP Image Editor GIMP
Headlamp Kubernetes Dashboard Headlamp
Kdenlive Video Editor Kdenlive
Kodi Media Center Kodi
Krita Digital Painting Krita
LibreOffice Office Suite LibreOffice
MissionCenter Project Management MissionCenter
Obsidian Note-taking App Obsidian
Pinta Image Editor Pinta
Raspberry Pi Imager Raspberry Pi Image Writer Raspberry Pi Imager
Remmina Remote Desktop Client Remmina
Spotify Music Streaming Spotify
Sublime Text Text Editor Sublime Text
VLC Media Player VLC
Vivaldi Web Browser Vivaldi
WPS Office Office Suite WPS Office
Zenmap Network Scanner Zenmap
Zoom Video Conferencing Zoom

Packages: npm

Software Type Link
Dockerfilelint Dockerfile linter https://github.com/replicatedhq/dockerfilelint

Tasks

Task Description Link
install_yubico_software Install keys, repositories, packages and dekstop files for Yubico infrastructure https://yubico.com
configure_zsh Installs files required by zsh, oh-my-zsh and powerlevel10k https://github.com/ohmyzsh/ohmyzsh https://github.com/romkatv/powerlevel10k
steampipe_plugins.yaml Install steampipe plugins https://steampipe.io/
configure_neofetch Installs and configures neofetch https://github.com/dylanaraps/neofetch

'configure_neofetch` task

This guide details the automation of Neofetch configuration adjustments using an Ansible playbook. By specifying various tasks in the playbook, users can easily comment out or uncomment specific lines within the Neofetch configuration file, toggle key-value pairs between "on" and "off", and ensure the creation of the Neofetch configuration file if it doesn't exist. Furthermore, it includes adding Neofetch to the global bashrc file for automatic execution.

The playbook operates based on a defined payload structure within a YAML file. Here's an example of the payload configuration for the Neofetch automation task:

neofetch:
  config_path: /home/{{ active_user }}/.config/neofetch/config.conf
  remove_lines:
    - Packages
    - Resolution
    - DE
    - WM
    - WM Theme
    - Theme
    - Icons
    - Terminal
    - Terminal Font
    - cols
  add_lines:
    - Disk
    - Local IP
  toggle_items:
    - key: 'color_blocks'
      value: 'off'

Explanation of Configuration Parameters:

Startup applications

Some applications are copied to autostart folder

OS Tweaks

Q&A

To Do

Known issues