Skip to content

nleiva/ansible-workstation

Repository files navigation

My workstation

Ansible Lint

I run RHEL9, which you can get for free.

The following playbook installs the software I need and customizes the environment for any time I need to go back to square one.

Dependencies

$ ansible-galaxy collection install community.general --upgrade

Running

Need a local user and become password. All inputs are in the inputs.yml file.

$ ansible-playbook rhel.yml -vK -e "ansible_user=nleiva"

Use of tags example: Don't re-install RHEL additional repositories and skip RPM Fusion.

$ ansible-playbook rhel.yml -vK -e "ansible_user=nleiva" --skip-tags "rhel_repo, fusion_repo"

Running on a new install

If you want to run it on a fresh system without Ansible.

$ python3 -m pip install --user ansible-core
$ python3 -m pip show ansible-core

Internal RH stuff

You need to manually install a couple of RPM's first: See method 3.

To skip these tasks, use tag red_hat:

$ ansible-playbook rhel.yml -vK -e "ansible_user=nleiva" --skip-tags "rhel_repo, fusion_repo, red_hat"

After restoring files

sudo cp MyCA.pem /etc/pki/ca-trust/source/anchors/MyCA.pem
sudo update-ca-trust

Disable Wayland

To be able to screen-share during meetings.

/etc/gdm/custom.conf

[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false
DefaultSession=gnome-xorg.desktop

Hack to fix SFTP for non-interactive sessions

Put following into top of ~/.bashrc on username of id on remote machine if that id uses bash (SOURCE: https://unix.stackexchange.com/a/505642).

# If not running interactively, don't do anything and return early
[[ $- == *i* ]] || return  

Fedora

After enabling the RH_internal stuff. To skip these tasks, use tag red_hat:

$ ansible-playbook fedora.yml -vK -e "ansible_user=nleiva" --skip-tags "rhel_repo, red_hat"