Setup Fedora Workstation Ansible
Overview
This post covers setting up personal a Fedora Workstation with Ansible, using a playbook with setup sections broken down into roles. Tags are used for testing and to further segragate tasks when modifying a configuration element.
Why?
- I have been wanting to learn Ansible and there is nothing like doing the thing to help learn it.
- I went through a couple of iterations of trying out Linux distros and took several Fedora Spins for a… spin. Automation was needed.
I thought I would share what I have to help out a fellow learner and to act as a reminder for me. The playbook is intended to be run locally on the workstation you wish to configure. It
Requirements
- Fresh installation of Fedora Workstation.
- Tested with Fedora 38 and Gnome 44.
- Ansible
- Git
|
|
Adjust the variable files for global variables and for each role.
- Global: group_vars/all.yml
- Role:
/vars/vars.yml
Playbook
The playbook defines:
- the host inventory.
- Assumed localhost. #TODO: Add multiple hosts for automation across the home network.
- root access for operations needing administrative privelege.
- Use –ask-become-pass or -K for privilege escalation password.
- the roles to be called.
- System
- User
- App-Packages
- App-Config
- Desktop-Customisation
Tags may be used to target a role or particular task.
Usage
First:
- Update any var files and global vars as required.
- From within the ansible-workstation directory:
Then run one of the following examples:
|
|
Roles
The following roles are utilised and are intended to run in sequence.
1. System
Anything system or host related.
Tasks:
- Set hostname.
2. User
User related settings and config.
Tasks:
- Create directory structure.
- Add SSH Keys.
- Add git config.
3. App-Packages
Installation of repos, flatpaks, and app packages.
Tasks:
- Add RPM and third party repos.
- Add Flatpak repo.
- Install:
- Drivers.
- Gnome Packages.
- Shell Extensions.
- Codecs.
- User Packages.
- User Flatpaks.
- Remove unwanted packages.
4. App-Config
Set application settings and config.
Tasks:
5. Desktop-Customisation
Set the desktop how we like it.
Tasks:
- Install and apply:
- Theme.
- Icons.
- Cursors.
- Wallpaper.
- Apply:
- Common Gnome Settings.
- FileChooser.
- Numlock State.
- Set Shell Extensions.
- User Themes.
- ArcMenu Settings.
- Dash to Dock Settings.
- Dash to Panel Settings.
- Open Weather Settings.
- Common Gnome Settings.
Tags
Tags are heavily utilised throughout the playbook so you can target or test specific areas.
Available Tags
Show available tags:
|
|
|
|
Todo
Items that would like to add to the playbook.
- Add avatar for login prompt.
- Set Power to Performance.
- Add LibreWolf config.
- Add Evolution config and backup/restore.
- Check and mount data and gaming drives.
Summary
I have had a blast learning this far and am looking forward to further automation. Hope this helps you on your automation journey!
Ansible Official Documentation:
Cheers.