-
Notifications
You must be signed in to change notification settings - Fork 0
Process flow of creating Hosts, Roles, Groups
Hamzaukw edited this page Sep 8, 2025
·
1 revision
How LuxNix uses Ansible to manage hosts, roles, configurations, and services is explained and documented in user-management.md file.
A. Adding a New Host ( user-management.md)
-
Add the Host to Inventory:
- Edit
inventory/hosts.iniand assign the new host to a group.
- Edit
-
Define Host-Specific Variables:
- Create a new file in
inventory/host_vars/named<hostname>.yml. - Include any special configurations (e.g., kernel, disk, GPU settings) that apply to this host.
- Create a new file in
-
Group-Level Configurations (if needed):
- If the host inherits configurations from its group, update
inventory/group_vars/<group>.yml.
- If the host inherits configurations from its group, update
-
Merged Variables:
- Validate that
merged_vars/<hostname>.ymlcorrectly reflects the combined settings.
- Validate that
-
Deployment:
- Run: devenv tasks run autoconf:finished
-
Enable a role in group settings (
inventory/group_vars/<group>.yaml)- If a role should be enabled for all hosts in a group, define the role in this file.
-
Enable a role for a specific host
- If a role should apply only to a particular host, define it in the host's specific configuration file (
inventory/host_vars/<hostname>.yml).
- If a role should apply only to a particular host, define it in the host's specific configuration file (
-
Define additional role-specific configurations (
luxnix/autoconf/group_vars.yml)- Some roles require extra parameters; these are set in a dedicated configuration file that maps roles to their required settings.
-
Enable services using
host_services(ansible/inventory/host_vars/)orgroup_services(ansible/inventory/group_vars/)- Services can be enabled at either the host level (specific to one machine) or group level (applied to all machines in the group).
-
Deploy the updated configuration
- After defining the roles and services, run the deployment command to apply them.
- Add a new group section and list the hosts etc under it (
inventory/hosts.ini) - This step ensures that Ansible recognizes the new group and applies configurations to its hosts.
- Built the configuration files by running ("bnsc"). If bnsc doen't work, then first run direnv allow.
- Define a new file to store the group's variables (
inventory/group_vars/<new_group>.yaml) - This file will hold configurations that apply to all hosts in the group. For example:
- group_roled:{}
- group_services:{}
- group_luxnix:{}
- Enable roles and services at the group level by adding relevant variables (
inventory/group_vars/<new_group>.yaml) - Define which roles and services should be active for the entire group.
- Rebuild rebiuld nix config,merged_vars and inventory.yml will be generated automatically.
- Roles need to be add in systems/x86_64-linux/relevant_host file/default.nix
- If necessary, update the global configuration to include defaults for the new group (
luxnix/autoconf/group_vars.yml) - This file can be used to provide default settings for the new group.
For deployment run-ansible
- Add configurations that apply to all hosts in the group.
-
Path:
inventory/group_vars/<new_group>.yaml - This file stores variables for the group, such as system settings, network configurations, package management, etc.
- If specific hosts within the group need unique configurations, update their individual settings.
-
Path:
inventory/host_vars/<hostname>.yml - This ensures that a host can have additional settings on top of the group defaults.
- If the new group requires default values for certain configurations, update the global variables file.
-
Path:
luxnix/autoconf/group_vars.yml - This file provides base settings, which can be overridden at the group or host level.
- Run the appropriate deployment command to apply all new settings.
- Installation Guide - NixOS and Setting Up Luxnix
- Flake.nix & Garbage Collection
- Access Management
- Roles
- LX Cheatsheet
- tmux CLI Cheatsheet
- Deployment Guide
- Development
- Hardware Setup
- Network Architecture
- Security Improvements
- Security
- Service Architecture
- User Management
- Systemd tmpfiles Rules in NixOS
- Common Errors
- NixOs Configuration Testing with Eval
- System Language Change
- Roles Documentation
- Doc Maintenance Schedule
- Luxnix Server Setup with example
- Postgres Config Guide
- Postgres Documentation
- Postgres gc-10 Declarative Setup Summary
- Endoreg Central Architecture
- Readme
- Ansible CMDB Readme
- Process flow of creating Hosts, Roles, Groups
- Adding a New User Configuration
- Maintenance & Security: Auto Update #6
- Home Configuration Autoconf Flow (Step-by-Step)
- Guide to Define New Setting With Example
- Autoconfig- create inventory.yml using Python Script
- Updated : Generating home config files using autoconfig
- git
- vscode
- fix_long_lines
- kernel
- keycloak-setup
- network
- setup-mail
- setup-s04
- syncthing
- 2025-01-29 - postgres