Skip to content

zahidkizmaz/arch-setup-playbook

Repository files navigation

My Personal Arch Linux Setup Playbook

desktop

How to run

Destination Machine:

After a fresh arch installation and before running the playbook, you may follow these steps:

  1. Add your non-root user to sudo (wheel) group. This user also will be used as an ansible user.
  2. Install dependencies:
    pacman -S openssh python python-pip
  3. Enable ssh service:
    systemctl enable sshd

Host Machine:

Add the host machine's ssh keys to the destination machine.

ssh-copy-id {{user name}}@{{ ip of the destination machine}}

Create an inventory file

---
all:
    hosts:
        { { host_address } }:
            ansible_user: { { user_name } }

Install ansible

OR

Recommended for local development

poetry install

Now it is possible to run following commands with poetry run without having to install ansible globally.

Example:

poetry run ansible-galaxy install -r requirements.yml

Install playbook dependencies

ansible-galaxy install -r requirements.yml

Run the install playbook

ansible-playbook -K --inventory inventory.yml install.yml

Update the system

This updates all the packages installed by playbook.

Such as:

  • AUR packages
  • pacman packages
  • zsh plugins
  • pipx packages
  • flatpak packages
  • mise plugins
  • tmux plugins
  • npm global plugins
  • rust programming language
  • nvim packages and tree sitter grammars

Run the update playbook remotely

ansible-playbook -K --inventory inventory.yml update.yml

Run the update playbook locally

ansible-playbook -K --connection local --inventory localhost, update.yml

Testing

Installation playbook can be tested locally using docker.

docker build . -t dev_env
docker run --it dev_env

This doesn't include flatpak role due to limitations of docker.

About

Personal arch linux setup&configuration ansible playbook.

Topics

Resources

License

Stars

Watchers

Forks