feat/rolling-vault-unseal #20
@ -11,11 +11,11 @@ module: ednz_cloud.hashistack.consul_acl_bootstrap
|
|||||||
|
|
||||||
short_description: Bootstraps ACL for a Consul cluster.
|
short_description: Bootstraps ACL for a Consul cluster.
|
||||||
|
|
||||||
version_added: "1.0.0"
|
version_added: "0.1.0"
|
||||||
|
|
||||||
description:
|
description:
|
||||||
- This module bootstraps ACL (Access Control List) for a Consul cluster. It performs the ACL bootstrap operation,
|
- This module bootstraps ACL (Access Control List) for a Consul cluster. It performs the ACL bootstrap operation,
|
||||||
creating the initial tokens needed for secure communication within the cluster.
|
creating the initial tokens needed for secure communication within the cluster.
|
||||||
|
|
||||||
options:
|
options:
|
||||||
api_addr:
|
api_addr:
|
||||||
@ -40,10 +40,10 @@ author:
|
|||||||
EXAMPLES = r"""
|
EXAMPLES = r"""
|
||||||
# Example: Bootstrap ACL for a Consul cluster
|
# Example: Bootstrap ACL for a Consul cluster
|
||||||
- name: Bootstrap ACL for Consul cluster
|
- name: Bootstrap ACL for Consul cluster
|
||||||
ednz_cloud.hashistack.consul_acl_bootstrap:
|
ednz_cloud.hashistack.consul_acl_bootstrap:
|
||||||
api_addr: 127.0.0.1
|
api_addr: 127.0.0.1
|
||||||
scheme: http
|
scheme: http
|
||||||
port: 8500
|
port: 8500
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = r"""
|
RETURN = r"""
|
||||||
|
@ -60,15 +60,15 @@ state:
|
|||||||
type: dict
|
type: dict
|
||||||
returned: always
|
returned: always
|
||||||
sample:
|
sample:
|
||||||
- AccessorID: "b780e702-98ce-521f-2e5f-c6b87de05b24",
|
- AccessorID: "b780e702-98ce-521f-2e5f-c6b87de05b24",
|
||||||
- SecretID: "3f4a0fcd-7c42-773c-25db-2d31ba0c05fe",
|
- SecretID: "3f4a0fcd-7c42-773c-25db-2d31ba0c05fe",
|
||||||
- Name: "Bootstrap Token",
|
- Name: "Bootstrap Token",
|
||||||
- Type: "management",
|
- Type: "management",
|
||||||
- Policies: null,
|
- Policies: null,
|
||||||
- Global: true,
|
- Global: true,
|
||||||
- CreateTime: "2017-08-23T22:47:14.695408057Z",
|
- CreateTime: "2017-08-23T22:47:14.695408057Z",
|
||||||
- CreateIndex: 7,
|
- CreateIndex: 7,
|
||||||
- ModifyIndex: 7
|
- ModifyIndex: 7
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
@ -11,11 +11,13 @@ module: ednz_cloud.hashistack.vault_init
|
|||||||
|
|
||||||
short_description: Manages the initialization of HashiCorp Vault.
|
short_description: Manages the initialization of HashiCorp Vault.
|
||||||
|
|
||||||
|
version_added: "0.1.0"
|
||||||
|
|
||||||
description:
|
description:
|
||||||
- This module initializes HashiCorp Vault, ensuring that it is securely set up for use.
|
- This module initializes HashiCorp Vault, ensuring that it is securely set up for use.
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
- C(hvac) (L(Python library,https://hvac.readthedocs.io/en/stable/overview.html))
|
- C(hvac) (L(Python library,https://hvac.readthedocs.io/en/stable/overview.html))
|
||||||
|
|
||||||
options:
|
options:
|
||||||
api_url:
|
api_url:
|
||||||
|
@ -7,66 +7,70 @@ __metaclass__ = type
|
|||||||
|
|
||||||
DOCUMENTATION = r"""
|
DOCUMENTATION = r"""
|
||||||
---
|
---
|
||||||
module: my_test
|
module: ednz_cloud.hashistack.vault_unseal
|
||||||
|
|
||||||
short_description: This is my test module
|
short_description: Unseals a Vault cluster.
|
||||||
|
|
||||||
# If this is part of a collection, you need to use semantic versioning,
|
version_added: "0.1.0"
|
||||||
# i.e. the version is of the form "2.5.0" and not "2.4".
|
|
||||||
version_added: "1.0.0"
|
|
||||||
|
|
||||||
description: This is my longer description explaining my test module.
|
description:
|
||||||
|
- This module unseals a Vault cluster by submitting the necessary unseal keys. It checks whether the Vault is sealed and performs the unseal operation if needed. The response will reflect the state after the last unseal key is submitted.
|
||||||
|
|
||||||
|
requirements:
|
||||||
|
- C(hvac) (L(Python library,https://hvac.readthedocs.io/en/stable/overview.html))
|
||||||
|
|
||||||
options:
|
options:
|
||||||
name:
|
api_url:
|
||||||
description: This is the message to send to the test module.
|
description: The URL of the Vault API.
|
||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
new:
|
tls_verify:
|
||||||
description:
|
description: Whether to verify TLS certificates.
|
||||||
- Control to demo if the result of this module is changed or not.
|
|
||||||
- Parameter description can be a list as well.
|
|
||||||
required: false
|
required: false
|
||||||
type: bool
|
type: bool
|
||||||
# Specify this value according to your collection
|
default: true
|
||||||
# in format of namespace.collection.doc_fragment_name
|
key_shares:
|
||||||
# extends_documentation_fragment:
|
description: List of unseal keys required to unseal the Vault.
|
||||||
# - my_namespace.my_collection.my_doc_fragment_name
|
required: false
|
||||||
|
type: list
|
||||||
|
default: []
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- Your Name (@yourGitHubHandle)
|
- Bertrand Lanson (@ednz_cloud)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = r"""
|
EXAMPLES = r"""
|
||||||
# Pass in a message
|
# Example: Unseal a Vault cluster
|
||||||
- name: Test with a message
|
- name: Unseal Vault cluster
|
||||||
my_namespace.my_collection.my_test:
|
ednz_cloud.hashistack.vault_unseal:
|
||||||
name: hello world
|
api_url: "https://127.0.0.1:8200"
|
||||||
|
tls_verify: true
|
||||||
|
key_shares:
|
||||||
|
- "key1"
|
||||||
|
- "key2"
|
||||||
|
- "key3"
|
||||||
|
|
||||||
# pass in a message and have changed true
|
# Example: Unseal Vault cluster with no TLS verification
|
||||||
- name: Test with a message and changed output
|
- name: Unseal Vault cluster without TLS verification
|
||||||
my_namespace.my_collection.my_test:
|
ednz_cloud.hashistack.vault_unseal:
|
||||||
name: hello world
|
api_url: "https://127.0.0.1:8200"
|
||||||
new: true
|
tls_verify: false
|
||||||
|
key_shares:
|
||||||
# fail the module
|
- "key1"
|
||||||
- name: Test failure of the module
|
- "key2"
|
||||||
my_namespace.my_collection.my_test:
|
|
||||||
name: fail me
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = r"""
|
RETURN = r"""
|
||||||
# These are examples of possible return values, and in general should use other names for return values.
|
state:
|
||||||
original_message:
|
description: Information about the state of the Vault unseal operation.
|
||||||
description: The original name param that was passed in.
|
type: dict
|
||||||
type: str
|
|
||||||
returned: always
|
returned: always
|
||||||
sample: 'hello world'
|
sample:
|
||||||
message:
|
sealed: true,
|
||||||
description: The output message that the test module generates.
|
t: 3,
|
||||||
type: str
|
n: 5,
|
||||||
returned: always
|
progress: 2,
|
||||||
sample: 'goodbye'
|
version: "0.6.2"
|
||||||
"""
|
"""
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
import traceback
|
import traceback
|
||||||
|
Loading…
Reference in New Issue
Block a user