Ansible playbooks for provisioning Fedora Workstations with tools which are commonly used in DevOps environments.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Ansible playbooks for provisioning Fedora Workstations with tools which are commonly used in DevOps environments.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
-
Install git, python, ansible
sudo -i dnf install -y git python3-pip pip3 install ansible
-
Clone repository
# Create directory for github repository mkdir -p ~/git/github cd ~/git/github # Clone (pull) git repository git clone https://github.com/mikeeq/ansible-ops-workstation.git
-
Change
user_name
inplaybooks/group_vars/all.yml
to your Fedora username and run Ansible# Go to repository directory cd ansible-ops-workstation/playbooks # Edit playbooks/group_vars/all.yml, change user_name vi group_vars/all.yml # Run Ansible ansible-playbook -i ../inventory/hosts.yml fedora.yml -K
-
Reboot your machine to apply all changes
-
Open terminal, login as root, upgrade your OS:
sudo -i hostnamectl set-hostname mikeePC dnf upgrade -y
-
Reboot your machine
reboot
-
Install
- VSCode - https://code.visualstudio.com/download
- Ubuntu 22.04 WSL2
- Docker Desktop for Windows - https://docs.docker.com/desktop/windows/install/
- Windows Terminal
-
Open WSL2 terminal, login as root, upgrade your OS:
sudo -i apt-get update apt-get upgrade
-
Install git, python, ansible
sudo -i apt-get install -y git python3-pip pip3 install ansible
-
Clone repository
# Create directory for github repository mkdir -p ~/git/github cd ~/git/github # Clone (pull) git repository git clone https://github.com/mikeeq/ansible-ops-workstation.git
-
Change
user_name
inplaybooks/group_vars/all.yml
to your WSL username (link) and run Ansible# Go to repository directory cd ansible-ops-workstation/playbooks # Edit playbooks/group_vars/all.yml, change user_name vi group_vars/all.yml # Run Ansible ansible-playbook -i ../inventory/hosts.yml wsl-ubuntu.yml -K
-
Install PowerLevel10K font on Windows - https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
-
Copy Windows Terminal config from - https://github.com/mikeeq/ansible-ops-workstation/blob/main/roles/desktop/machines/wsl/templates/settings.json
- and paste it here -
C:\Users\${WINDOWS_USER_NAME}\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
- and paste it here -
-
Copy VScode config file from - https://github.com/mikeeq/ansible-ops-workstation/blob/main/roles/desktop/apps/vscode/files/settings.json
- and paste it here -
C:/Users/${WINDOWS_USER_NAME}/AppData/Roaming/Code/User/settings.json
- and paste it here -
-
You can also install VScode extensions manually from the list here - https://github.com/mikeeq/ansible-ops-workstation/blob/main/playbooks/group_vars/all.yml#L146-L173, by finding them in the VScode UI and clicking install or via CLI by executing:
code --install-extension ${EXTENSION_NAME}
-
Restart your VScode/Windows Terminal to see your new oh-my-zsh :)
Remember to use VScode with Remote WSL extension and store all your unix/git files/repositories under WSL2 to not encounter any issues with file permissions, etc.
I also recommend to use builtin terminal in VSCode as it also really configurable and works like a charm with oh-my-zsh and P10K
- ms-vscode-remote.remote-wsl - https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl
-
MacOS disk utility doesn't show free space on a harddisk
- create ntfs partition on any free disk space on that disk, then shrink/resize your APFS partitions/containers.
-
To fix Docker on newer Fedora's installations:
vi /etc/default/grub systemd.unified_cgroup_hierarchy=0 grub2-mkconfig -o /boot/grub2/grub.cfg
-
Fix selinux policies for OpenVPN certs custom path
sudo semanage fcontext -a -t home_cert_t /home/mikee/Documents/vpns/certs_vpn/ca.crt sudo restorecon -R -v /home/mikee/Documents/vpns/certs_vpn/
-
How to enable bitlocker on macbook
-
Configure BitLocker to work without a TPM:
Start => run => gpedit.msc Open the Local Computer Policy node Navigate to Computer Configuration \ Administrative Templates \ Windows Components \ Bit Locker Drive Encryption \ Operating System Drives Double click on Require additional authentication at startup Enable the feature and check the box next to `Allow BitLocker without a compatible TPM`, click Apply and Ok, and close out of Local Group Policy Editor.
-
-
To save last boot entry in grub - add lines below to
/etc/default/grub
and rungrub2-mkconfig -o /boot/grub2/grub.cfg
GRUB_DEFAULT=saved GRUB_SAVEDEFAULT=true
-
To setup hp printer
hp-setup # to configure HP printer
-
To disable KDE wallet when using pip3
python3 -m keyring --disable
-
hid_apple mods - https://github.com/free5lot/hid-apple-patched
cd /sys/module/hid_apple/parameters echo 1 > swap_fn_leftctrl echo 1 > swap_opt_cmd
# vi /etc/modprobe.d/hid_apple.conf options hid_apple swap_fn_leftctrl=1 options hid_apple swap_opt_cmd=1 options hid_apple iso_layout=1 # after adding this options to the file, you need to rebuild your initramfs ## in Fedora dracut -f
-
Add SSH keys, config and private gpg keys from keybase
keybase pgp list keybase pgp export --query $KEY_ID -s > private.gpg; gpg --import private.gpg; rm -v private.gpg keybase pgp export --query $KEY_ID > public.gpg; gpg --import public.gpg; rm -v public.gpg git-crypt add-gpg-user -n --trusted $USER_ID[could be email]
-
To save HTTPS git credentials
git config --global credential.helper store git config lfs.cachecredentials true
-
How to install latest NVIDIA driver on Linux:
- Fedora 36 issues with NVIDIA driver
# Install DKMS to automatically install Nvidia driver when updating kernel dnf install dkms kernel-devel kernel-headers gcc make acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig vdpauinfo libva-vdpau-driver libva-utils # Add opensource nvidia driver - nouveau to blacklist vi /etc/modprobe.d/nvidia-installer-disable-nouveau.conf blacklist nouveau options nouveau modeset=0 vi /etc/default/grub GRUB_CMDLINE_LINUX="rhgb quiet rd.driver.blacklist=nouveau" grub2-mkconfig -o /boot/grub2/grub.cfg # Rebuild initramfs dracut -f systemctl set-default multi-user.target reboot # Download latest cuda driver and nvidia driver and go to download path # CUDA - https://developer.nvidia.com/cuda-downloads bash cuda_11.5.1_495.29.05_linux.run # cuda will also install nvidia driver, but in older version # Nvidia driver - https://www.nvidia.com/en-us/drivers/unix/ bash NVIDIA-Linux-x86_64-495.46.run systemctl set-default graphical.target dnf remove xorg-x11-drv-nouveau reboot # to dynamically change current session to non-graphical user interface systemctl isolate multi-user.target # to revert back to graphical systemctl isolate graphical.target # If there are some issues with booting to graphical environment, i.e.: with API mismatch error, execute `dracut -f` to rebuild initramfs with newer version of driver # dmesg|grep -i nvrm -A3 # [ 113.647054] NVRM: API mismatch: the client has the version 460.91.03, but # NVRM: this kernel module has the version 390.144. Please # NVRM: make sure that this kernel module and all NVIDIA driver # NVRM: components have the same version. dracut -f # If you fail to boot to Fedora, you can edit boot entry in grub by clicking "e" in grub bootmenu and in line starting with "linux ..." add at the end "init 3" to boot in multi-user.target (without graphical interface)
-
To fix purple'ish screen, enable OC and Fan control (I recommend to use GreenWithEnvy - gwe (installed using flatpak)) apply those changes to
/etc/X11/xorg.conf
:Section "Device" # To fix ddcutil Option "RegistryDwords" "RMUseSwI2c=0x01; RMI2cSpeed=100" # To enable fan control and OC Option "Coolbits" "12" EndSection Section "Screen" # To fix purple'ish screen ## These settings can be controled using nvidia-settings --> X Server Display Configuration --> Advanced... --> Force Composition Pipeline --> Save to X Configuration File Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, AllowGSYNCCompatible=On}" EndSection ### Example /etc/X11/xorg.conf Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "NVIDIA GeForce RTX 3070" Option "RegistryDwords" "RMUseSwI2c=0x01; RMI2cSpeed=100" Option "Coolbits" "12" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "nvidiaXineramaInfoOrder" "DFP-1" Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, AllowGSYNCCompatible=On}" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection
-
To enable "outdated" gnome extension add used gnome-shell version to
shell-version
table inmetadata.json
extension's filegnome-shell --version GNOME Shell 41.2 EXTENSION_NAME=cpufreq@konkor vi ~/.local/share/gnome-shell/extensions/${EXTENSION_NAME}/metadata.json { "shell-version": [ "41.2 ] }
-
To turn off hdd
echo 1 > /sys/block/sdb/device/delete
-
To open remote VScode session from CLI:
code --folder-uri vscode-remote://ssh-remote+${SSH_USER}@${HOST}${PATH} # Example code --folder-uri vscode-remote://ssh-remote+user@192.168.1.10/home/user/git
Distributed under the GNU GPLv3 License. See COPYING
for more information.
Twitter - @mikeeqp
Project Link: https://github.com/mikeeq/ansible-ops-workstation