Skip to content

jeremylongshore/tons-of-skills-marketplace / plugins/devops/ansible-playbook-creator/skills/creating-ansible-playbooks

creating-ansible-playbooks

Verified

Execute use when you need to work with Ansible automation. This skill provides Ansible playbook creation with comprehensive guidance and automation. Trigger with phrases like "create Ansible playbook", "automate with Ansible", or "configure with Ansible".

FileKindSize
SKILL.mdskill md4.1 KB
assets/README.mdmarkdown501 B
assets/playbook_template.ymlconfig2.3 KB
assets/validation_rules.ymlconfig3.7 KB
references/README.mdmarkdown67 B
scripts/README.mdmarkdown436 B
scripts/secure_playbook.pyexecutablescript10.7 KB
scripts/test_playbook.shexecutablescript8.7 KB
scripts/validate_playbook.pyexecutablescript10.7 KB

assets/validation_rules.yml

View on GitHub
# validation_rules.yml

# --- General Playbook Structure Rules ---
playbook_structure:
  # Rule: Playbook must have a name
  name_required: true
  # Rule: Playbook must have at least one host
  hosts_required: true
  # Rule: Playbook should have a gather_facts setting (explicitly true or false)
  gather_facts_required: true
  gather_facts_default: true # Consider setting to false if facts are not needed for performance
  # Rule: Playbook should have a become setting (explicitly true or false) if privilege escalation is needed
  become_recommended: true # Recommend setting this, but don't enforce.
  become_default: false # Set to true if most tasks require sudo.

# --- Task Specific Rules ---
task_rules:
  # Rule: Each task must have a name
  name_required: true
  # Rule: Avoid using the 'shell' module unless necessary. Prefer specific modules.
  no_shell_unless_necessary: true
  shell_exceptions: # List of commands where shell is acceptable.  Helps reduce false positives.
    - "ls"
    - "grep"
    - "awk"
    - "sed"
  # Rule: Use 'changed_when' instead of relying on return codes for idempotency.
  changed_when_recommended: true
  # Rule: Use 'failed_when' to handle unexpected errors.
  failed_when_recommended: true

# --- Security Best Practices ---
security_rules:
  # Rule: Avoid storing secrets directly in playbooks. Use Ansible Vault or a secrets management system.
  no_plain_text_secrets: true
  secret_keywords: # List of keywords that indicate a potential secret
    - "password"
    - "secret"
    - "token"
    - "key"
  # Rule: Use 'become' with caution.  Limit its scope to only the tasks that require it.
  become_caution: true
  # Rule: Avoid using '*' in host patterns in production. Be specific.
  no_wildcard_hosts: true
  # Rule: Validate input parameters to prevent injection vulnerabilities.
  validate_input: true
  input_validation_regex: "example-value" # Example regex for validating input.  Should be customized per variable.

# --- Idempotency Rules ---
idempotency_rules:
  # Rule: Ensure tasks are idempotent. They should only make changes when necessary.
  idempotent_tasks: true
  # Rule: Use 'creates' or 'removes' in file/copy/template modules for idempotency.
  file_idempotency: true
  # Rule: Use 'state' parameter where applicable (e.g., present/absent for files/packages).
  state_parameter_required: true
  state_parameter_exceptions:  # Some modules don't use state, so exclude them
    - "debug"
    - "include_tasks"
    - "include_role"

# --- Error Handling Rules ---
error_handling_rules:
  # Rule: Implement proper error handling using 'rescue' and 'always' blocks.
  rescue_blocks_recommended: true
  always_blocks_recommended: true
  # Rule: Use 'ignore_errors' with caution.  Document why it is necessary.
  ignore_errors_caution: true

# --- Variable Usage Rules ---
variable_rules:
  # Rule: Use descriptive variable names.
  descriptive_variable_names: true
  # Rule: Define variables in a structured way (e.g., group_vars, host_vars).
  structured_variables: true
  # Rule: Avoid using hardcoded values directly in tasks. Use variables instead.
  no_hardcoded_values: true

# --- Module Specific Rules (Example for apt module) ---
apt_module_rules:
  # Rule: Ensure 'update_cache' is set to 'yes' when installing packages for the first time.
  update_cache_recommended: true
  # Rule: Specify a state (present/absent) when managing packages.
  state_required: true
  default_package: "YOUR_VALUE_HERE" # Example default package

# --- Platform Specific Rules ---
platform_rules:
  # Rule: Use conditional statements ('when') to handle platform-specific differences.
  conditional_platform_tasks: true
  supported_platforms: # List of supported platforms
    - "Ubuntu"
    - "CentOS"
    - "Windows"
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall