Rewrite inventory to use standard

This commit is contained in:
2026-04-28 16:23:13 -04:00
parent 1759682aef
commit 7bc1f8f702
3 changed files with 33 additions and 17 deletions

View File

@@ -16,11 +16,12 @@ This project demonstrates enterprise-grade automation for the complete lifecycle
- **Automation Engine**: Ansible Core 2.15+ - **Automation Engine**: Ansible Core 2.15+
- **Platform**: Ansible Automation Platform 2.4+ - **Platform**: Ansible Automation Platform 2.4+
- **Hypervisor**: Microsoft Hyper-V (Windows Server 2019/2022) - **Hypervisor**: Microsoft Hyper-V (Windows Server 2019/2022) - hyperv1.lan.toal.ca
- **Guest OS**: Windows Server 2019/2022 - **Guest OS**: Windows Server 2019/2022
- **CMDB**: ServiceNow ITSM - **CMDB**: ServiceNow ITSM
- **Version Control**: Git (GitOps workflow) - **Version Control**: Git (GitOps workflow)
- **Authentication**: Active Directory / Kerberos - **Authentication**: Active Directory / Kerberos
- **Inventory**: ToalLab standard inventory (/home/ptoal/Dev/inventories/toallab-inventory)
### Connectivity Model ### Connectivity Model
@@ -49,17 +50,17 @@ ServiceNow CMDB
├── ansible.cfg # Ansible configuration with Windows/WinRM defaults ├── ansible.cfg # Ansible configuration with Windows/WinRM defaults
├── collections/ ├── collections/
│ └── requirements.yml # Required Ansible collections │ └── requirements.yml # Required Ansible collections
├── inventory/ ├── inventory/ # DEPRECATED: Using toallab-inventory
│ ├── production/ │ ├── production/ # Legacy - for reference only
│ │ └── hosts.yml # Production inventory │ │ └── hosts.yml
│ └── staging/ │ └── staging/
│ └── hosts.yml # Staging inventory (future) │ └── hosts.yml # Staging inventory (future)
├── group_vars/ ├── group_vars/ # DEPRECATED: Moved to toallab-inventory
│ ├── all.yml # Global variables │ ├── all.yml # Legacy - for reference only
│ ├── hyperv_hosts.yml # Hyper-V host configuration │ ├── hyperv_hosts.yml
│ ├── windows_servers.yml # Windows Server defaults │ ├── windows_servers.yml
│ └── web_servers.yml # IIS/web server configuration │ └── web_servers.yml
├── host_vars/ # Host-specific variables (future) ├── host_vars/ # DEPRECATED: Moved to toallab-inventory
├── playbooks/ ├── playbooks/
│ ├── provision-vm.yml # VM provisioning workflow │ ├── provision-vm.yml # VM provisioning workflow
│ ├── patch-vms.yml # Windows Update automation │ ├── patch-vms.yml # Windows Update automation
@@ -158,12 +159,30 @@ winrm set winrm/config/service '@{AllowUnencrypted="false"}'
5. Implement check mode support 5. Implement check mode support
6. Test in staging environment first 6. Test in staging environment first
### Inventory Configuration
This project uses the ToalLab standard inventory located at `/home/ptoal/Dev/inventories/toallab-inventory`.
**Inventory Groups:**
- `hyperv` - Hyper-V hosts (hyperv1.lan.toal.ca)
- `windows_servers` - All Windows Server VMs
- `web_servers` - IIS/web servers
- `app_servers` - Application servers
- `db_servers` - Database servers
**Group Variables:**
- `/home/ptoal/Dev/inventories/toallab-inventory/group_vars/hyperv/vars.yml` - Hyper-V defaults
- `/home/ptoal/Dev/inventories/toallab-inventory/group_vars/windows_servers/vars.yml` - Windows defaults
**Host Variables:**
- `/home/ptoal/Dev/inventories/toallab-inventory/host_vars/hyperv1.lan.toal.ca/vars.yml` - Hypervisor config
### Variable Precedence ### Variable Precedence
Follow this hierarchy (least to most specific): Follow this hierarchy (least to most specific):
1. `group_vars/all.yml` - Global defaults 1. `group_vars/all.yml` - Global defaults (in toallab-inventory)
2. `group_vars/<group>.yml` - Group-specific 2. `group_vars/<group>.yml` - Group-specific (in toallab-inventory)
3. `host_vars/<host>.yml` - Host-specific 3. `host_vars/<host>.yml` - Host-specific (in toallab-inventory)
4. Playbook `vars:` - Playbook overrides 4. Playbook `vars:` - Playbook overrides
5. Extra vars (`-e`) - Runtime overrides 5. Extra vars (`-e`) - Runtime overrides

View File

@@ -33,9 +33,6 @@ ansible-playbook playbooks/install-iis.yml --limit web_servers
``` ```
. .
├── ansible.cfg # Ansible configuration ├── ansible.cfg # Ansible configuration
├── inventory/ # Inventory files
│ ├── production/
│ └── staging/
├── playbooks/ # Playbooks by use case ├── playbooks/ # Playbooks by use case
│ ├── provision-vm.yml │ ├── provision-vm.yml
│ ├── patch-vms.yml │ ├── patch-vms.yml

View File

@@ -1,5 +1,5 @@
[defaults] [defaults]
inventory = inventory/production inventory = /home/ptoal/Dev/inventories/toallab-inventory
host_key_checking = False host_key_checking = False
retry_files_enabled = False retry_files_enabled = False
roles_path = roles roles_path = roles