Skip to content

DOTFILES. Automating with Bash and Ansible for seamless deployment and configuration management in ARCH Linux environments.

Notifications You must be signed in to change notification settings

Capi-nemoo/nmConfigurator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nemooconfig

giphy.mp4

Arch Linux Setup Project Documentation

arch-linux-setup/
├── inventory/
│   ├── localhost.ini
├── playbooks/
│   ├── base.yml
│   ├── packages.yml
│   ├── dotfiles.yml
├── roles/
│   ├── base/
│   │   ├── tasks.yml
│   ├──packages/
│   │   ├── tasks.yml
│   └── dotfiles/
│       ├── tasks.yml
├── vars/
│   ├── common.yml
├── ansible.cfg
├── README.md

Inventory

localhost.ini

This file defines the machine where Ansible will run. In this case, it's set up for local execution without SSH. If you want to expand, you can add configurations for remote servers or even dynamic inventories for virtual machines or containers.


Playbooks

base.yml

Handles the initial setup of your Arch Linux system. This includes disk partitioning, installing the base system, and setting up the bootloader. You could expand this to include disk encryption (LUKS), RAID configurations, or other advanced disk setups.

packages.yml

This playbook installs all the necessary tools and applications. It uses pacman for official packages and yay for AUR packages. You could enhance it with custom profiles like "developer", "gaming", or "minimal" to tailor the installed packages to different needs.

dotfiles.yml

This playbook manages your dotfiles by cloning your repository and linking the necessary configuration files into your home directory. In the future, you could add features like automatic backups of existing files before overwriting them or support for different configuration profiles (e.g., work vs. personal).


Roles

roles/base/tasks.yml

This role focuses on the system’s base configuration. It sets up users, installs essential services like NetworkManager, and applies any required basic configurations. Expansion ideas include adding support for UEFI vs. Legacy BIOS setups or managing extra system services like SSH or Firewalld.

roles/packages/tasks.yml

Installs all your specified packages. It separates installation between pacman packages and AUR packages using yay. You could make this more dynamic by including conditional installs based on the type of machine (e.g., laptop, desktop, server) or by adding optional features toggled through variables.

roles/dotfiles/tasks.yml

Handles your dotfiles. It clones your repository and creates symbolic links for configurations in $HOME. You could expand it to manage multiple repositories or provide automated backups of existing files before replacing them.


Vars

vars/common.yml

This file stores shared variables used across playbooks and roles. It includes settings like the username, lists of packages (pacman and aur), and any other reusable configurations. Future improvements could include adding regional settings (timezone, keyboard layout) or flags for optional installations.


Root Files

ansible.cfg

Defines how Ansible behaves. It specifies where to find roles, inventories, and how to handle privileges. This file could be expanded to support SSH configurations or other advanced inventory setups for remote execution.

README.md

The main documentation for the project. It explains how to use the playbooks, install Ansible, and run the setup. You could expand this by adding troubleshooting tips, a guide for contributions, or explanations of the project’s structure.


Expansion Ideas

  1. Support for Multiple Systems
    Add configurations for derivatives like Manjaro or EndeavourOS.

  2. Automated GUI Setup
    Include setups for graphical environments like GNOME or i3wm.

  3. Custom Profiles
    Create profiles like "developer", "gamer", or "server" to streamline installations.

  4. Testing and Validation
    Use tools like Molecule to test playbooks and ensure everything works as expected.

  5. Backup Integration
    Automate restoration of user data and configurations from backups.

  6. Resource Optimization
    Check available resources like disk space or memory and adjust the setup accordingly.


List of items each file should contain

inventory/localhost.ini

  • Define the local host
  • Reference ansible_connection=local

playbooks/base.yml

  • Reference hosts: localhost
  • Use become: true for privilege escalation
  • Include the base role
  • Use variables from vars/common.yml (no explanation, just reference them)
  • Main tasks for installing and configuring the base system (list tasks in YAML format)

playbooks/packages.yml

  • Reference hosts: localhost
  • Use become: true for privilege escalation
  • Include the packages role
  • Use variables for package lists (from vars/common.yml)
  • Main tasks for installing official repo packages and AUR packages

playbooks/dotfiles.yml

  • Reference hosts: localhost
  • Use become: true for privilege escalation
  • Include the dotfiles role
  • Use variables for the dotfiles repository (from vars/common.yml)
  • Tasks to clone the repository and create symbolic links

roles/base/tasks.yml

  • Tasks to partition the disk
  • Tasks to format the partitions
  • Tasks to mount the base system
  • Tasks to pacstrap the base system
  • Tasks to generate fstab
  • Tasks to configure timezone, locale, and hostname
  • Tasks to install the bootloader

roles/packages/tasks.yml

  • Tasks to update the package database
  • Tasks to install packages using pacman (from the list in vars/common.yml)
  • Tasks to install yay
  • Tasks to install AUR packages (from the list in vars/common.yml)

roles/dotfiles/tasks.yml

  • Tasks to clone the dotfiles repository (using variables from vars/common.yml)
  • Tasks to create symbolic links for dotfiles
  • Tasks to ensure correct permissions for config files

vars/common.yml

  • Variable for the final username
  • Variable for the list of pacman packages
  • Variable for the list of AUR packages
  • Variable for the dotfiles repository URL
  • Variable for timezone and locale

ansible.cfg

  • Basic Ansible settings
  • Path to roles
  • Define the inventory
  • Minimum recommended settings (privilege escalation, host_key_checking, etc.)

README.md

  • Short description of the project
  • Basic instructions to run playbooks
  • Prerequisites (having Ansible, live environment with internet)
  • References to files and roles

About

DOTFILES. Automating with Bash and Ansible for seamless deployment and configuration management in ARCH Linux environments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published