Debian Codegraph @

ansible_collections/community/general/plugins/doc_fragments/_onepassword.py

raw
1 # Copyright (c) 2023, Ansible Project
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 # Note that this doc fragment is **PRIVATE** to the collection. It can have breaking changes at any time.
6 # Do not use this from other collections or standalone plugins/modules!
7
8 from __future__ import annotations
9
10
11 class ModuleDocFragment:
12 DOCUMENTATION = r"""
13 requirements:
14 - C(op) 1Password command line utility version 2 or later.
15 - See U(https://support.1password.com/command-line/)
16 options:
17 master_password:
18 description: The password used to unlock the specified vault.
19 aliases: ['vault_password']
20 type: str
21 section:
22 description: Item section containing the field to retrieve (case-insensitive). If absent, returns first match from any
23 section.
24 domain:
25 description: Domain of 1Password.
26 default: '1password.com'
27 type: str
28 subdomain:
29 description: The 1Password subdomain to authenticate against.
30 type: str
31 account_id:
32 description: The account ID to target.
33 type: str
34 username:
35 description: The username used to sign in.
36 type: str
37 secret_key:
38 description: The secret key used when performing an initial sign in.
39 type: str
40 service_account_token:
41 description:
42 - The access key for a service account.
43 type: str
44 vault:
45 description: Vault containing the item to retrieve (case-insensitive). If absent, searches all vaults.
46 type: str
47 connect_host:
48 description: The host for 1Password Connect. Must be used in combination with O(connect_token).
49 type: str
50 env:
51 - name: OP_CONNECT_HOST
52 version_added: 8.1.0
53 connect_token:
54 description: The token for 1Password Connect. Must be used in combination with O(connect_host).
55 type: str
56 env:
57 - name: OP_CONNECT_TOKEN
58 version_added: 8.1.0
59 """
60
61 LOOKUP = r"""
62 options:
63 service_account_token:
64 env:
65 - name: OP_SERVICE_ACCOUNT_TOKEN
66 version_added: 8.2.0
67 notes:
68 - This lookup uses an existing 1Password session if one exists. If not, and you have already performed an initial sign in
69 (meaning C(~/.op/config), C(~/.config/op/config) or C(~/.config/.op/config) exists), then only the O(master_password)
70 is required. You may optionally specify O(subdomain) in this scenario, otherwise the last used subdomain is used by C(op).
71 - This lookup can perform an initial login by providing O(subdomain), O(username), O(secret_key), and O(master_password).
72 - Can target a specific account by providing the O(account_id).
73 - Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal
74 credentials needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or
75 greater in strength to the 1Password master password.
76 - This lookup stores potentially sensitive data from 1Password as Ansible facts. Facts are subject to caching if enabled,
77 which means this data could be stored in clear text on disk or in a database.
78 - Tested with C(op) version 2.7.2.
79 """