Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
- Puppet >= 4.10.0 < 7.0.0
- , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'bryxxit-onepassword_lookup', '0.2.0'
Learn more about managing modules with a PuppetfileDocumentation
setup
Setup 1password connect accoriding to the official docs https://support.1password.com/secrets-automation/
usage
Set your hiera.yml to lookup from the onepassword lookup.
---
version: 5
defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.
hierarchy:
....
- name: "Secret data"
lookup_key: onepassword_lookup
options:
vaults:
- 'development'
- 'puppet-common'
url: 'http://localhost:8080' ## you can now also use https
token: 'sometoken'
# optional, retrieve everything (as label:value pairs), not just username/password
# valid as of version 0.1.4
get_all_fields: true
next try looking up a key. Note items can have the same title inside onepassword. These are now combined and returned as an array. Does not work yet when multiple vaults are defined.
root@puppet:/# puppet lookup mynote
note content
root@puppet:/# puppet lookup dev-db-login
---
username: test
password: test
root@puppet:/# puppet lookup dev-db-pass
--- testpass
root@puppet:/# puppet lookup dev-db-login2
---
- username: test
password: test
- username: web
password: web
These can be referenced in a puppet manifest using:
$var = lookup('dev-db-pass')
$var = lookup('dev-db-login2.password')
$var = lookup('dev-db-login2.password', undef, undef, 'Default Value')
Getting All Fields
if get_all_fields
is set to true
in the options, all fields set on a credential are returned from 1password,
using label as the key:
puppet lookup 'Test Credential'
---
username: root
password: my_password
notesPlain: 'This is a password for some server'
text: test
text2: test2
These can be referenced in puppet via:
$var = lookup('Test Credential.text2')
Changelog
Release 0.2.0
Features added Fail gracefully if unable to successfully contact 1password connect by justafish
Release 0.1.4
Features added all_fields option from pull request by akomakom
Bugfixes none
Release 0.1.3
Features
Bugfixes added ssl support for requests
Release 0.1.2
Duplicate titles now return array. Features
Bugfixes
Release 0.1.1
added document support. And logins now also return username Features
Bugfixes
Known Issues
Release 0.1.0
first release Features
Bugfixes
Known Issues