managing-configuration — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited managing-configuration (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill provides guidance for automating server and application configuration using Ansible and related tools. It covers playbook creation, role structure, inventory management (static and dynamic), secret management, testing patterns, and idempotency best practices to ensure safe, repeatable configuration deployments.
Invoke this skill when:
---
# site.yml
- name: Configure web servers
hosts: webservers
become: yes
tasks:
- name: Ensure nginx is installed
apt:
name: nginx
state: present
notify: Restart nginx
- name: Start nginx service
service:
name: nginx
state: started
enabled: yes
handlers:
- name: Restart nginx
service:
name: nginx
state: restartedRun with:
ansible-playbook -i inventory/production site.ymlRun playbooks multiple times without unintended side effects. Use state-based modules (present, started, latest) instead of imperative commands.
Idempotent (good):
- name: Ensure package installed
apt:
name: nginx
state: presentNot idempotent (avoid):
- name: Install package
command: apt-get install -y nginxSee references/idempotency-guide.md for detailed patterns.
Static Inventory: INI or YAML files for stable environments. Dynamic Inventory: Scripts or plugins for cloud environments (AWS, Azure, GCP).
Example static inventory (INI):
[webservers]
web1.example.com ansible_host=10.0.1.10
web2.example.com ansible_host=10.0.1.11
[webservers:vars]
nginx_worker_processes=4See references/inventory-management.md for dynamic inventory setup.
Playbooks: Orchestrate multiple tasks and roles for specific deployments. Roles: Reusable, self-contained configuration units with standardized directory structure.
Standard role structure:
roles/nginx/
├── defaults/ # Default variables
├── tasks/ # Task files
├── handlers/ # Change handlers
├── templates/ # Jinja2 templates
├── files/ # Static files
└── meta/ # DependenciesSee references/role-structure.md for complete role patterns.
ansible-vault: Built-in encryption for sensitive data. HashiCorp Vault: Enterprise-grade secrets management with dynamic credentials.
Encrypt secrets:
ansible-vault create group_vars/all/vault.yml
ansible-playbook site.yml --ask-vault-passSee references/secrets-management.md for Vault integration.
Step 1: Define inventory
# inventory/production
[webservers]
web1.example.com
web2.example.comStep 2: Create playbook structure
---
- name: Configure application
hosts: webservers
become: yes
pre_tasks:
- name: Update package cache
apt:
update_cache: yes
roles:
- common
- application
post_tasks:
- name: Verify service
uri:
url: http://localhost:8080/health
status_code: 200Step 3: Test with check mode
ansible-playbook -i inventory/production site.yml --check --diffStep 4: Execute playbook
ansible-playbook -i inventory/production site.ymlSee references/playbook-patterns.md for advanced patterns.
Step 1: Initialize role structure
ansible-galaxy init roles/myappStep 2: Define tasks
# roles/myapp/tasks/main.yml
---
- name: Install application dependencies
apt:
name: "{{ item }}"
state: present
loop: "{{ myapp_dependencies }}"
- name: Deploy application
template:
src: app.conf.j2
dest: /etc/myapp/app.conf
notify: Restart myappStep 3: Add handler
# roles/myapp/handlers/main.yml
---
- name: Restart myapp
service:
name: myapp
state: restartedStep 4: Initialize Molecule testing
cd roles/myapp
molecule init scenario default --driver-name dockerStep 5: Run tests
molecule testSee references/testing-guide.md for comprehensive testing patterns.
Step 1: Install AWS collection
ansible-galaxy collection install amazon.awsStep 2: Configure dynamic inventory
# inventory/aws_ec2.yml
plugin: aws_ec2
regions:
- us-east-1
filters:
tag:Environment: production
instance-state-name: running
keyed_groups:
- key: tags.Role
prefix: role
hostnames:
- tag:Name
compose:
ansible_host: private_ip_addressStep 3: Verify inventory
ansible-inventory -i inventory/aws_ec2.yml --listStep 4: Run playbook
ansible-playbook -i inventory/aws_ec2.yml site.ymlSee references/inventory-management.md for multi-cloud patterns.
Step 1: Create encrypted vault file
ansible-vault create group_vars/all/vault.ymlStep 2: Add secrets
# group_vars/all/vault.yml (encrypted)
vault_db_password: "SuperSecretPassword"
vault_api_key: "sk-1234567890"Step 3: Reference in variables
# group_vars/all/vars.yml (unencrypted)
db_password: "{{ vault_db_password }}"
api_key: "{{ vault_api_key }}"Step 4: Use in playbook
- name: Configure database
template:
src: db.conf.j2
dest: /etc/app/db.conf
vars:
database_password: "{{ db_password }}"Step 5: Run with vault password
ansible-playbook site.yml --vault-password-file ~/.vault_passSee references/secrets-management.md for HashiCorp Vault integration.
Infrastructure-as-Code (Terraform): Creating cloud infrastructure resources. Kubernetes: Container orchestration and configuration. Chef/Puppet: Existing deployments with high migration costs.
Best practice: Terraform provisions, Ansible configures.
Workflow:
See references/decision-framework.md for detailed decision trees.
Step 1: Lint playbooks
ansible-lint playbooks/Step 2: Check mode (dry run)
ansible-playbook site.yml --check --diffStep 3: Test roles with Molecule
cd roles/myapp
molecule testStep 4: Verify idempotence
molecule idempotence.ansible-lint:
---
exclude_paths:
- molecule/
- venv/
skip_list:
- name[casing]
warn_list:
- experimentalmolecule.yml:
---
driver:
name: docker
platforms:
- name: instance
image: ubuntu:22.04
pre_build_image: true
provisioner:
name: ansible
verifier:
name: ansibleSee references/testing-guide.md for complete testing strategies.
Connection failures:
ansible all -i inventory -m pingssh -vvv user@hostansible-playbook site.yml --ask-passHandler not firing:
changed status)meta: flush_handlers to force earlier)Variable not defined:
- debug: var=myvaransible-playbook site.yml -vIdempotency violations:
changed on every runcommand/shellSee references/troubleshooting.md for comprehensive debugging guide.
infrastructure-as-code:
kubernetes-operations:
building-ci-pipelines:
secret-management:
security-hardening:
testing-strategies:
references/playbook-patterns.md - Playbook structure, handlers, tags, variablesreferences/role-structure.md - Role directory layout, best practices, collectionsreferences/inventory-management.md - Static, dynamic, and hybrid inventory patternsreferences/secrets-management.md - ansible-vault and HashiCorp Vault integrationreferences/testing-guide.md - Molecule, ansible-lint, check mode, verificationreferences/idempotency-guide.md - Ensuring safe, repeatable executionsreferences/decision-framework.md - Tool selection and workflow designreferences/chef-puppet-migration.md - Migrating from legacy tools to Ansiblereferences/troubleshooting.md - Common issues and debugging techniquesexamples/playbooks/ - Complete playbook examplesexamples/roles/ - Production-ready role templatesexamples/inventory/ - Static and dynamic inventory configurationsexamples/molecule/ - Molecule test scenariosscripts/validate-playbook.py - Validate playbook syntax and structurescripts/generate-inventory.py - Generate inventory from cloud providersscripts/ansible-vault-helper.sh - Vault management utilitiesscripts/molecule-runner.sh - Automated Molecule test execution~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.