Migrated from legacy playbook repo into Ansible collection format: Roles (171 total): - common: 44 roles (fact gathering, SSH setup, utilities) - configuration: 32 roles (system config, networking, satellite) - provisioning: 16 roles (VMware, Azure, physical server deployment) - security: 15 roles (OpenSCAP hardening, certificates, AD integration) - monitoring: 12 roles (Zabbix, logging agents, metrics) - networking: 12 roles (DNS, DHCP, network interfaces) - satellite: 4 roles (Pulp/Satellite management) - misc: 36 roles (various utilities) Playbooks (159 total): - provisioning: 14 playbooks - azure: 13 playbooks - configuration: 22 playbooks - maintenance: 10 playbooks - security: 10 playbooks - monitoring: 9 playbooks - vcenter: 6 playbooks - networking: 7 playbooks - misc: 65 playbooks
remove-netbox-tag
This role removes tags from virtual machines in NetBox.
Requirements
- netbox.netbox collection installed
- NETBOX_API and NETBOX_TOKEN environment variables or variables set
Role Variables
netbox_tags: List of tags to remove from the virtual machine (default: [])
Available Tags
The following tags are available in your NetBox instance:
732- VM size/identifierTAPI- TAPI systemsansibleaccess- Ansible management access enabledautomation- Automated deploymentazure-sync- Azure synchronizedEXAMPLE-CORP.COM- CCTA domain systemsDMZ23.EXAMPLE.COM- DMZ zone 23DMZ.EXAMPLE.COM- DMZ zone 24itsm- ITSM managed systemslarge-vm- Large virtual machinemedium-vm- Medium virtual machinenoansibleaccess- No Ansible accessnotinsatellite- Not in satellitesatellite- Satellite managedsmall-vm- Small virtual machinevmware-auto-updated- VMware auto-updated
To see all available tags, run:
curl -H "Authorization: Token YOUR_TOKEN" https://netbox.example.EXAMPLE-CORP.COM/api/extras/tags/ -k | jq '.results[] | {name, slug}'
Example Playbook
- hosts: servers
roles:
- role: remove-netbox-tag
Usage with NetBox inventory and limit:
# Set environment variable for NetBox token
export NETBOX_TOKEN="your-netbox-api-token"
# Remove tags from specific hosts (with vault password for inventory)
ansible-playbook remove-netbox-tags.yml -i netbox.yml --limit "hostname.EXAMPLE-CORP.COM" -e '{"netbox_tags":["satellite","EXAMPLE-CORP.COM"]}' --ask-vault-pass
# Remove tags from multiple hosts
ansible-playbook remove-netbox-tags.yml -i netbox.yml --limit "*.EXAMPLE-CORP.COM" -e '{"netbox_tags":["production"]}' --ask-vault-pass
Note: Use JSON format -e '{"netbox_tags":["tag1","tag2"]}' to pass the tags list properly.
License
GPL-2.0-or-later