This Ansible role is used to pull a remote copy of an Ansible playbook that installs the packages, features, and configuration files required for my development environment from a source repository.
This Ansible playbook performs the following essential tasks:
Creating a New User and Granting Root Privileges: Enhance security and control by creating a new user and assigning it root privileges.
Keeping Apt Packages Up to Date: Ensure your system is up to date by updating and upgrading apt packages.
Configuring zsh as the Default Shell: Install and configure zsh as the default shell, providing advanced features and customization options.
Installing oh-my-zsh Plugins and P10K Theme: Enhance your shell experience by installing popular oh-my-zsh plugins and the visually appealing P10K theme.
Installing pyenv and pyenv-virtualenv Required Python Versions: Install pyenv, a flexible Python version management tool, and the specified Python interpreter versions.
Setting Global Environment with Python Versions: Set the global environment to use the selected Python interpreter versions for consistent Python development.
Managing Python Packages with pip: Install additional Python packages using the pip package manager.
Pulling the dotfile Repository from GitHub: Sync your configuration files by pulling the dotfile repository from GitHub.
Creating Symlinks to the ~/.config Directory: Organize your configuration files by creating symbolic links to the ~/.config directory.
This Ansible Playbook has been tested on the following Linux releases:
I've used this playbook to install packages on Ubuntu running on Windows Subsystem for Linux on Windows 11.
To run the playbook, ensure that you have the latest version of Ansible installed. Please follow the steps below:
Ansible is an agentless automation tool that you install on a single host (referred to as the control node). From the control node, Ansible can manage an entire fleet of machines and other devices (referred to as managed nodes) remotely with SSH, Powershell remoting, and numerous other transports, all from a simple command-line interface with no databases or daemons required.
To run the playbook, ensure that you have the latest version of Ansible installed. Please follow the steps below:
Update and Upgrade packages.
sudo apt update && sudo apt upgradeVerify whether pip is already installed for your preferred Python.
python3 -m pip -VIf all is well, you should see something like the following:
python3 -m pip -V
pip 21.0.1 from /usr/lib/python3.9/site-packages/pip (python 3.9)Use pip in your selected Python environment to install the Ansible package of your choice for the current user:
python3 -m pip install --user ansibleYou can test that Ansible is installed correctly by checking the version:
ansible --versionIf you see an error, See the Ansible documentation on Installing Ansible for more information.
To install and update packages, execute the following command as the root user. This command will pull the Ansible playbook repository from GitHub and execute all the tasks in order:
sudo ansible-pull -U https://github.com/santiagopereda/ansible_desktop.gitThis command performs a "pull" operation, retrieving the latest version of the Ansible playbook from the specified GitHub repository. It then applies the playbook locally, executing all the defined tasks sequentially. The playbook contains instructions to install and configure various packages, set up the development environment, and perform any necessary configurations.
Run the command with appropriate privileges, administrative access is required to install and update packages.
MIT
The role used for installing pyenv and python versions were referenced from markosamuli