{
  "id": "ansible",
  "name": "Ansible",
  "homepage": "https://docs.ansible.com/ansible/latest/reference_appendices/config.html",
  "description": "Ansible is a radically simple IT automation system.",
  "icon": "SimpleIcons:ansible",
  "executables": [
    "ansible",
    "ansible-playbook",
    "ansible-galaxy",
    "ansible-doc",
    "ansible-config",
    "ansible-lint"
  ],
  "dotfiles": {
    "paths": [
      "~/.ansible.cfg"
    ],
    "exclude": [
      "~/.ansible/cp/",
      "~/.ansible/pc/",
      "~/.ansible/tmp/",
      "~/.ansible/galaxy_cache/",
      "~/.ansible/roles/",
      "~/.ansible/collections/"
    ],
    "secret": [
      "~/.ansible/galaxy_token"
    ],
    "side_effect": false,
    "machine_lines": [
      {
        "file": "~/.ansible.cfg",
        "match": {
          "prefix": [
            "inventory",
            "roles_path",
            "collections_path",
            "private_key_file",
            "vault_password_file",
            "log_path"
          ]
        },
        "scope": "backup"
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Run ad-hoc task",
    "description": "Run a single module against a set of hosts with the ansible command. Playbooks (ansible-playbook), galaxy, vault handling and SSH argument passthrough are left out.",
    "quality": "ai-draft",
    "base": "fig:ansible",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": true
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/ansible.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "pattern",
        "label": "Host pattern",
        "description": "Inventory host, group or pattern, for example all or webservers.",
        "type": "string",
        "position": 0,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "inventory",
        "label": "Inventory",
        "description": "Inventory file or a comma-separated host list.",
        "type": "string",
        "option": [
          "--inventory",
          "-i"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "module_name",
        "label": "Module",
        "type": "string",
        "option": [
          "--module-name",
          "-m"
        ],
        "suggestions": [
          {
            "value": "ping",
            "label": "ping"
          },
          {
            "value": "command",
            "label": "command"
          },
          {
            "value": "shell",
            "label": "shell"
          },
          {
            "value": "copy",
            "label": "copy"
          },
          {
            "value": "setup",
            "label": "setup (gather facts)"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "args",
        "label": "Module arguments",
        "type": "string",
        "option": [
          "--args",
          "-a"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "limit",
        "label": "Limit to hosts",
        "type": "string",
        "option": [
          "--limit",
          "-l"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "user",
        "label": "Connect as user",
        "type": "string",
        "option": [
          "--user",
          "-u"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "private_key",
        "label": "Private key file",
        "type": "path",
        "option": [
          "--private-key",
          "--key-file"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "become",
        "label": "Become (privilege escalation)",
        "type": "boolean",
        "option": [
          "--become",
          "-b"
        ],
        "effect": "exec",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "ask_become_pass",
        "label": "Ask for become password",
        "type": "boolean",
        "option": [
          "--ask-become-pass",
          "-K"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "ask_pass",
        "label": "Ask for connection password",
        "type": "boolean",
        "option": [
          "--ask-pass",
          "-k"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "extra_vars",
        "label": "Extra variables",
        "description": "key=value pairs, YAML/JSON, or @file.",
        "type": "string",
        "option": [
          "--extra-vars",
          "-e"
        ],
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "forks",
        "label": "Parallel forks",
        "type": "integer",
        "option": [
          "--forks",
          "-f"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "check",
        "label": "Check mode (no changes)",
        "type": "boolean",
        "option": [
          "--check",
          "-C"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "diff",
        "label": "Show diffs",
        "type": "boolean",
        "option": [
          "--diff",
          "-D"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "list_hosts",
        "label": "List matching hosts only",
        "type": "boolean",
        "option": [
          "--list-hosts"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "one_line",
        "label": "Condensed output",
        "type": "boolean",
        "option": [
          "--one-line",
          "-o"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "ping",
        "label": "Ping hosts",
        "set": {
          "module_name": [
            "ping"
          ]
        },
        "lock": [
          "module_name"
        ],
        "fields": [
          "pattern",
          "module_name",
          "inventory",
          "limit",
          "user",
          "private_key",
          "ask_pass"
        ],
        "required": [
          "pattern"
        ]
      },
      {
        "id": "run-command",
        "label": "Run a command on hosts",
        "set": {
          "module_name": [
            "command"
          ]
        },
        "fields": [
          "pattern",
          "module_name",
          "args",
          "inventory",
          "limit",
          "user",
          "private_key",
          "become",
          "ask_become_pass",
          "ask_pass",
          "check"
        ],
        "required": [
          "pattern",
          "args"
        ]
      },
      {
        "id": "list-hosts",
        "label": "List matching hosts",
        "set": {
          "list_hosts": [
            true
          ]
        },
        "lock": [
          "list_hosts"
        ],
        "fields": [
          "pattern",
          "list_hosts",
          "inventory",
          "limit"
        ],
        "required": [
          "pattern"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "pattern",
          "inventory",
          "module_name",
          "args",
          "limit",
          "user",
          "private_key",
          "become",
          "ask_become_pass",
          "ask_pass"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "extra_vars",
          "forks",
          "check",
          "diff",
          "list_hosts",
          "one_line"
        ]
      }
    ]
  }
}
