> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# trustedshops-public/ansible

Execute common ansible functionality


## Commands

### check_connectivity

Check connectivity to hosts in inventory


| Parameter | Type | Default | Description |
|---|---|---|---|
| `host_pattern` | string | all | Host pattern to check |
| `inventory` | string |  | Path to inventory file |
| `limit` | string |  | Limit for connectivity check |
| `timeout` | integer | 30 | Timeout in seconds |

### install_ansible

Install ansible using pip3


| Parameter | Type | Default | Description |
|---|---|---|---|
| `version` | string | 2.9.* | Version of ansible to install |

### install_mitogen

Install mitogen using curl


| Parameter | Type | Default | Description |
|---|---|---|---|
| `install_path` | string | /opt/ansible/mitogen | Path to install mitogen into |
| `version` | string | 0.2.9 | Verion to install |

### install_roles

Install roles using ansible-galaxy


| Parameter | Type | Default | Description |
|---|---|---|---|
| `requirements_file` | string | requirements | Path to requirements file (with or without .y[a]ml) |
| `rewrite_github_clone_url` | boolean | false | Rewrite git urls for github to use https with env var GITHUB_TOKEN |

### provision

Provision playbook


| Parameter | Type | Default | Description |
|---|---|---|---|
| `ansible_version` | string | 2.9.* | Version of ansible to install |
| `attach_workspace` | boolean | true | Boolean for whether or not to attach to an existing workspace.
 |
| `check` | boolean | false | Don't make any changes. Try to predict some of the changes that may occur |
| `check_connectivity` | boolean | false | Check connectivity before executing playbook |
| `checkout` | boolean | true | Boolean for whether or not to checkout sources
 |
| `diff` | boolean | false | When changing (small) files and templates, show the differences in those files |
| `executor` | executor | default | Executor to use |
| `host_pattern` | string | all | Host pattern to check |
| `install_mitogen` | boolean | true | Install mitogen strategy |
| `install_roles` | boolean | true | Install roles using ansible-galaxy |
| `inventory` | string |  | Path to inventory file |
| `limit` | string |  | Limit for ansible execution |
| `mitogen_install_path` | string | /opt/ansible/mitogen | Path to install mitogen into |
| `mitogen_version` | string | 0.2.9 | Verion to install |
| `no_output_timeout` | string | 15m | Timeout after which CircleCI cancels the playbook execution |
| `playbook` | string |  | Path to playbook to execute |
| `roles_requirements_file` | string | requirements | Path to requirements file (with or without .y[a]ml) |
| `roles_rewrite_github_clone_url` | boolean | false | Rewrite git urls for github to use https with env var GITHUB_TOKEN |
| `skip_tags` | string |  | Tags to skip |
| `tags` | string |  | Tags to execute |
| `timeout` | integer | 30 | Timeout in seconds |
| `vault_file` | string |  | Vault file to use for password |
| `vault_password` | env_var_name | __NO_VAULT_PASSWORD__ | Environment variable to use for vault password |
| `workspace_root` | string | . | Workspace root path that is either an absolute path or a path relative to the working directory.
 |

### run_playbook

Run ansible playbook


| Parameter | Type | Default | Description |
|---|---|---|---|
| `check` | boolean | false | Don't make any changes. Try to predict some of the changes that may occur |
| `diff` | boolean | false | When changing (small) files and templates, show the differences in those files |
| `inventory` | string |  | Path to inventory file |
| `limit` | string |  | Limit for connectivity check |
| `no_output_timeout` | string | 15m | Timeout after which CircleCI cancels the playbook execution |
| `playbook` | string |  | Path to playbook to execute |
| `skip_tags` | string |  | Tags to skip |
| `tags` | string |  | Tags to execute |
| `vault_file` | string |  | Vault file to use for password |
| `vault_password` | env_var_name | __NO_VAULT_PASSWORD__ | Environment variable to use for vault password |

## Jobs

### provision

Provision playbook


| Parameter | Type | Default | Description |
|---|---|---|---|
| `ansible_version` | string | 2.9.* | Version of ansible to install |
| `attach_workspace` | boolean | true | Boolean for whether or not to attach to an existing workspace.
 |
| `check` | boolean | false | Don't make any changes. Try to predict some of the changes that may occur |
| `check_connectivity` | boolean | false | Check connectivity before executing playbook |
| `checkout` | boolean | true | Boolean for whether or not to checkout sources
 |
| `diff` | boolean | false | When changing (small) files and templates, show the differences in those files |
| `executor` | executor | default | Executor to use |
| `host_pattern` | string | all | Host pattern to check |
| `install_mitogen` | boolean | true | Install mitogen strategy |
| `install_roles` | boolean | true | Install roles using ansible-galaxy |
| `inventory` | string |  | Path to inventory file |
| `limit` | string |  | Limit for ansible execution |
| `mitogen_install_path` | string | /opt/ansible/mitogen | Path to install mitogen into |
| `mitogen_version` | string | 0.2.9 | Verion to install |
| `no_output_timeout` | string | 15m | Timeout after which CircleCI cancels the playbook execution |
| `playbook` | string |  | Path to playbook to execute |
| `roles_requirements_file` | string | requirements | Path to requirements file (with or without .y[a]ml) |
| `roles_rewrite_github_clone_url` | boolean | false | Rewrite git urls for github to use https with env var GITHUB_TOKEN |
| `skip_tags` | string |  | Tags to skip |
| `tags` | string |  | Tags to execute |
| `timeout` | integer | 30 | Timeout in seconds |
| `vault_file` | string |  | Vault file to use for password |
| `vault_password` | env_var_name | __NO_VAULT_PASSWORD__ | Environment variable to use for vault password |
| `workspace_root` | string | . | Workspace root path that is either an absolute path or a path relative to the working directory.
 |

## Executors

### default

Default executor


| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | 3.11 | Pick a specific circleci/base image variant: https://hub.docker.com/r/cimg/python/tags
 |

## Examples

### job_minimal_github

Help users getting started with the orb

```yaml
version: '2.1'
orbs:
  ansible: trustedshops-public/ansible@<version>
workflows:
  continious:
    jobs:
      - ansible/provision:
          ansible-version: 2.9.15
          filters:
            branches:
              only:
                - main
          inventory: inventory/prod.ini
          mitogen-version: 0.2.9
          name: deploy-prod
          playbook: web.yml
          roles-rewrite-github-clone-url: true
          skip-tags: no-cd
          vault-password: VAULT_PASSWORD_PROD
  version: 2
```

### job_minimal_github_with_connectivity_check

Help users getting started with the orb

```yaml
version: '2.1'
orbs:
  ansible: trustedshops-public/ansible@<version>
workflows:
  continious:
    jobs:
      - ansible/provision:
          ansible_version: 2.9.15
          check_connectivity: true
          filters:
            branches:
              only:
                - main
          inventory: inventory/prod.ini
          limit: webservers
          mitogen_version: 0.2.9
          name: deploy-prod
          playbook: web.yml
          roles_rewrite_github_clone_url: true
          skip-tags: no-cd
          vault_password: VAULT_PASSWORD_PROD
  version: 2
```