rules_ansible
Overview
Bazel rules for Ansible
Setup
bazel_dep(name = "rules_ansible", version = "{version}")
rules_ansible
Rules
Aspects
ansible_lint_test
load("@rules_ansible//ansible:defs.bzl", "ansible_lint_test")
ansible_lint_test(name, config, playbook)
A test rule for running ansible-lint on an Ansible playbook.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| config | The ansible-lint config file to use | Label | optional | "@rules_ansible//ansible:lint_config" |
| playbook | The ansible_playbook target to lint. | Label | required |
ansible_playbook
load("@rules_ansible//ansible:defs.bzl", "ansible_playbook")
ansible_playbook(name, config, hosts, inventory, playbook, roles, vault)
A rule for running Ansible playbooks
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| config | The path to an Ansible config file. | Label | optional | "@rules_ansible//ansible:config" |
| hosts | Ansible hosts file | Label | required | |
| inventory | Ansible inventory files | List of labels | optional | [] |
| playbook | The ansible playbook yaml file. | Label | required | |
| roles | The source files for all ansible roles required by the playbook. | List of labels | optional | [] |
| vault | Vault encrypted files required by the playbook. These are never decrypted on disk. Ansible decrypts them in memory at runtime using the vault password file located by the launcher (a .vault_pass file next to the playbook, its parent package, or the workspace root) or one passed explicitly via --vault-password-file. | List of labels | optional | [] |
ansible_toolchain
load("@rules_ansible//ansible:defs.bzl", "ansible_toolchain")
ansible_toolchain(name, ansible, ansible_core, ansible_lint)
An ansible toolchain
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| ansible | An ansible py_library target. | Label | required | |
| ansible_core | An ansible-core py_library target. | Label | required | |
| ansible_lint | An ansible-lint py_library target. | Label | required |
ansible_lint_aspect
load("@rules_ansible//ansible:defs.bzl", "ansible_lint_aspect")
ansible_lint_aspect()
An aspect for linting ansible targets.
ASPECT ATTRIBUTES
ATTRIBUTES