consul_binding_rule
Manipulate Consul binding rules
Collection: community.general
Full Name: community.general.consul_binding_rule
Synopsis
Manipulate Consul binding rules
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| auth_method | string | yes | The name of the auth method that this rule applies to. | |
| bind_name | string | The name to bind to a token at login-time. What it binds to can be adjusted with different values of the O(bind_type) parameter. | ||
| bind_type | string | Specifies the way the binding rule affects a token created at login. | ||
| bind_vars | dict | Specifies the templated policy variables when O(bind_type) is set to V(templated-policy). | ||
| ca_path | string | Target PEM CA bundle path. | ||
| description | string | Free form human readable description of the binding rule. | ||
| host | string | localhost | Consul agent hostname. | |
| name | string | yes | Specifies a name for the binding rule. Note: This is used to identify the binding rule. But since the API does not support a name, it is prefixed to the description. | |
| port | int | 8500 | Consul agent HTTP port. | |
| scheme | string | http | HTTP or HTTPS protocol. | |
| selector | string | Specifies the expression used to match this rule against valid identities returned from an auth method validation. If empty this binding rule matches all valid identities returned from the auth method. | ||
| state | string | present | Whether the binding rule should be present or absent. | |
| token | string | Consul ACL token; private argument. | ||
| validate_certs | bool | true | Validate the server certificate. |
Example
yaml
- community.general.consul_binding_rule:
auth_method: minikube
bind_name: '{{ serviceaccount.name }}'
bind_type: service
description: example rule
name: my_name
token: '{{ consul_management_token }}'
name: Create a binding rule
- community.general.consul_binding_rule:
auth_method: minikube
name: my_name
state: absent
name: Remove a binding rule