From 67f95cb499bb82a9c6eed0fb3f250ac995ce1272 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Thu, 31 Jan 2019 20:18:55 +0530 Subject: [PATCH] Onepassword document fixes (#51527) Signed-off-by: Abhijeet Kasurde --- lib/ansible/plugins/lookup/onepassword.py | 28 ++++++++++--------- lib/ansible/plugins/lookup/onepassword_raw.py | 18 ++++++------ 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/ansible/plugins/lookup/onepassword.py b/lib/ansible/plugins/lookup/onepassword.py index c11f4d3c82..5162464f4a 100644 --- a/lib/ansible/plugins/lookup/onepassword.py +++ b/lib/ansible/plugins/lookup/onepassword.py @@ -1,22 +1,24 @@ # -*- coding: utf-8 -*- -# (c) 2018, Scott Buchanan -# (c) 2016, Andrew Zenk (lastpass.py used as starting point) -# (c) 2018, Ansible Project +# Copyright: (c) 2018, Scott Buchanan +# Copyright: (c) 2016, Andrew Zenk (lastpass.py used as starting point) +# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type -ANSIBLE_METADATA = {'metadata_version': '1.1', - 'status': ['preview'], - 'supported_by': 'community'} +ANSIBLE_METADATA = { + 'metadata_version': '1.1', + 'status': ['preview'], + 'supported_by': 'community' +} DOCUMENTATION = """ lookup: onepassword author: - - Scott Buchanan - - Andrew Zenk - - Sam Doran + - Scott Buchanan (@scottsb) + - Andrew Zenk (@azenk) + - Sam Doran (@samdoran) version_added: "2.6" requirements: - C(op) 1Password command line utility. See U(https://support.1password.com/command-line/) @@ -25,10 +27,10 @@ DOCUMENTATION = """ - C(onepassword) wraps the C(op) command line utility to fetch specific field values from 1Password. options: _terms: - description: identifier(s) (UUID, name, or subdomain; case-insensitive) of item(s) to retrieve + description: identifier(s) (UUID, name, or subdomain; case-insensitive) of item(s) to retrieve. required: True field: - description: field to return from each matching item (case-insensitive) + description: field to return from each matching item (case-insensitive). default: 'password' master_password: description: The password used to unlock the specified vault. @@ -49,14 +51,14 @@ DOCUMENTATION = """ description: The secret key used when performing an initial sign in. version_added: '2.7' vault: - description: Vault containing the item to retrieve (case-insensitive). If absent will search all vaults + description: Vault containing the item to retrieve (case-insensitive). If absent will search all vaults. default: None notes: - This lookup will use an existing 1Password session if one exists. If not, and you have already performed an initial sign in (meaning C(~/.op/config exists)), then only the C(master_password) is required. You may optionally specify C(subdomain) in this scenario, otherwise the last used subdomain will be used by C(op). - This lookup can perform an initial login by providing C(subdomain), C(username), C(secret_key), and C(master_password). - - Due to the B(very) sensitive nature of these credentials, it is B(highly) recommeneded that you only pass in the minial credentials + - Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal credentials needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or greater in strength to the 1Password master password. - This lookup stores potentially sensitive data from 1Password as Ansible facts. diff --git a/lib/ansible/plugins/lookup/onepassword_raw.py b/lib/ansible/plugins/lookup/onepassword_raw.py index f7642a5882..a6824c34d0 100644 --- a/lib/ansible/plugins/lookup/onepassword_raw.py +++ b/lib/ansible/plugins/lookup/onepassword_raw.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# (c) 2018, Scott Buchanan -# (c) 2016, Andrew Zenk (lastpass.py used as starting point) -# (c) 2018, Ansible Project +# Copyright: (c) 2018, Scott Buchanan +# Copyright: (c) 2016, Andrew Zenk (lastpass.py used as starting point) +# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) @@ -14,9 +14,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ lookup: onepassword_raw author: - - Scott Buchanan - - Andrew Zenk - - Sam Doran + - Scott Buchanan (@scottsb) + - Andrew Zenk (@azenk) + - Sam Doran (@samdoran) version_added: "2.6" requirements: - C(op) 1Password command line utility. See U(https://support.1password.com/command-line/) @@ -25,7 +25,7 @@ DOCUMENTATION = """ - C(onepassword_raw) wraps C(op) command line utility to fetch an entire item from 1Password options: _terms: - description: identifier(s) (UUID, name, or domain; case-insensitive) of item(s) to retrieve + description: identifier(s) (UUID, name, or domain; case-insensitive) of item(s) to retrieve. required: True master_password: description: The password used to unlock the specified vault. @@ -46,14 +46,14 @@ DOCUMENTATION = """ description: The secret key used when performing an initial sign in. version_added: '2.7' vault: - description: Vault containing the item to retrieve (case-insensitive). If absent will search all vaults + description: Vault containing the item to retrieve (case-insensitive). If absent will search all vaults. default: None notes: - This lookup will use an existing 1Password session if one exists. If not, and you have already performed an initial sign in (meaning C(~/.op/config exists)), then only the C(master_password) is required. You may optionally specify C(subdomain) in this scenario, otherwise the last used subdomain will be used by C(op). - This lookup can perform an initial login by providing C(subdomain), C(username), C(secret_key), and C(master_password). - - Due to the B(very) sensitive nature of these credentials, it is B(highly) recommeneded that you only pass in the minial credentials + - Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal credentials needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or greater in strength to the 1Password master password. - This lookup stores potentially sensitive data from 1Password as Ansible facts.