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, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.0.0 < 7.0.0
- Archlinux , , , , , ,
This module has been deprecated by its author since Mar 2nd 2023.
The author has suggested puppet-vault as its replacement.
Start using this module
Documentation
puppet-vault
Puppet module to install and run Hashicorp Vault.
Support
This module is currently only tested on:
- Ubuntu 16.04
- Ubuntu 18.04
- CentOS/RedHat 6
- CentOS/RedHat 7
Usage
include vault
By default, with no parameters the module will configure vault with some sensible defaults to get you running, the following parameters may be specified to configure Vault. Please see The official documentation for further details of acceptable parameter values.
Parameters
Setup parameters
-
user
: Customise the user vault runs as, will also create the user unlessmanage_user
is false. -
manage_user
: Whether or not the module should create the user. -
group
: Customise the group vault runs as, will also create the user unlessmanage_group
is false. -
manage_group
: Whether or not the module should create the group. -
bin_dir
: Directory the vault executable will be installed in. -
config_dir
: Directory the vault configuration will be kept in. -
config_mode
: Mode of the configuration file (config.json). Defaults to '0750' -
purge_config_dir
: Whether theconfig_dir
should be purged before installing the generated config. -
install_method
: Supports the valuesrepo
orarchive
. See Installation parameters. -
service_name
: Customise the name of the system service -
service_enable
: Tell the OS to enable or disable the service at system startup -
service_ensure
: Tell the OS whether the service should be running or stopped -
service_provider
: Customise the name of the system service provider; this also controls the init configuration files that are installed. -
service_options
: Extra argument to pass tovault server
, as per:vault server --help
-
num_procs
: Sets theGOMAXPROCS
environment variable, to determine how many CPUs Vault can use. The official Vault Terraform install.sh script sets this to the output ofnprocs
, with the comment, "Make sure to use all our CPUs, because Vault can block a scheduler thread". Default: number of CPUs on the system, retrieved from theprocessorcount
fact. -
manage_storage_dir
: When using the file storage, this boolean determines whether or not the path (as specified in the['file']['path']
section of the storage config) is created, and the owner and group set to the vault user. Default:false
-
manage_service_file
: Manages the service file regardless of the defaults. Default: See Installation parameters. -
manage_config_file
: Manages the configuration file. When set to false,config.json
will not be generated.manag_storage_dir
is ignored. Default:true
Installation parameters
When install_method
is repo
When repo
is set the module will attempt to install a package corresponding with the value of package_name
.
package_name
: Name of the package to install, default:vault
package_ensure
: Desired state of the package, default:installed
bin_dir
: Set to the path where the package will install the Vault binary, this is necessary to correctly manage thedisable_mlock
option.manage_service_file
: Will manage the service file in case it's not included in the package, default: falsemanage_file_capabilities
: Will manage file capabilities of the vault binary. default:false
When install_method
is archive
When archive
the module will attempt to download and extract a zip file from the download_url
, the extracted file will be placed in the bin_dir
folder.
The module will not manage any required packages to un-archive, e.g. unzip
. See puppet-archive
setup documentation for more details.
download_url
: Optional manual URL to download the vault zip distribution from. You can specify a local file on the server with a fully qualified pathname, or usehttp
,https
,ftp
ors3
based URI's. default:undef
download_url_base
: This is the base URL for the hashicorp releases. If no manualdownload_url
is specified, the module will download from hashicorp. default:https://releases.hashicorp.com/vault/
download_extension
: The extension of the vault download when using hashicorp releases. default:zip
download_dir
: Path to download the zip file to, default:/tmp
manage_download_dir
: Boolean, whether or not to create the download directory, default:false
download_filename
: Filename to (temporarily) save the downloaded zip file, default:vault.zip
version
: The Version of vault to download. default:1.4.2
manage_service_file
: Will manage the service file. default: truemanage_file_capabilities
: Will manage file capabilities of the vault binary. default:true
Configuration parameters
By default, with no parameters the module will configure vault with some sensible defaults to get you running, the following parameters may be specified to configure Vault. Please see The official documentation for further details of acceptable parameter values.
storage
: A hash containing the Vault storage configuration, default:
{ 'file' => { 'path' => '/var/lib/vault' }}
listener
: A hash or array of hashes containing the listener configuration(s), default:
{
'tcp' => {
'address' => '127.0.0.1:8200',
'tls_disable' => 1,
}
}
-
ha_storage
: An optional hash containing theha_storage
configuration -
seal
: An optional hash containing theseal
configuration -
telemetry
: An optional hash containing thetelemetry
configuration -
disable_cache
: A boolean to disable or enable the cache (default:undef
) -
disable_mlock
: A boolean to disable or enable mlock See below (default:undef
) -
default_lease_ttl
: A string containing the default lease TTL (default:undef
) -
max_lease_ttl
: A string containing the max lease TTL (default:undef
) -
enable_ui
: Enable the vault UI (requires vault 0.10.0+ or Enterprise) (default:undef
) -
api_addr
: Specifies the address (full URL) to advertise to other Vault servers in the cluster for client redirection. This value is also used for plugin backends. This can also be provided via the environment variable VAULT_API_ADDR. In general this should be set as a full URL that points to the value of the listener address (default:undef
) -
extra_config
: A hash containing extra configuration, intended for newly released configuration not yet supported by the module. This hash will get merged with other configuration attributes into the JSON config file.
Examples
class { '::vault':
storage => {
file => {
path => '/tmp',
}
},
listener => [
{
tcp => {
address => '127.0.0.1:8200',
tls_disable => 0,
}
},
{
tcp => {
address => '10.0.0.10:8200',
}
}
]
}
or alternatively using Hiera:
---
vault::storage:
file:
path: /tmp
vault::listener:
- tcp:
address: 127.0.0.1:8200
tls_disable: 1
- tcp:
address: 10.0.0.10:8200
vault::default_lease_ttl: 720h
mlock
By default vault will use the mlock
system call, therefore the executable will need the corresponding capability.
In production, you should only consider setting the disable_mlock
option on Linux systems that only use encrypted swap or do not use swap at all.
The module will use setcap
on the vault binary to enable this.
If you do not wish to use mlock
, set the disable_mlock
attribute to true
class { '::vault':
disable_mlock => true
}
Testing
First, bundle install
To run RSpec unit tests: bundle exec rake spec
To run RSpec unit tests, puppet-lint, syntax checks and metadata lint: bundle exec rake test
To run Beaker acceptance tests: BEAKER_set=<nodeset name> BEAKER_PUPPET_COLLECTION=puppet5 bundle exec rake acceptance
where <nodeset name>
is one of the filenames in spec/acceptance/nodesets
without the trailing .yml
,
e.g. ubuntu-18.04-x86_64-docker
.
Related Projects
hiera-vault
: A Hiera storage backend to retrieve secrets from Hashicorp's Vault
2020-05-27 2.3.0
- Add
manage_config_file
option - Update stm/file_capability dependency
- Update to vault 1.4.2
2020-02-01 2.2.0
- Add support for
api_addr
stanza - Update to vault 1.3.2
2019-08-19 2.1.0
- Add support for
seal
stanza - Remove duplicate TimeoutStopSec in systemd unit file
- Update to vault 1.2.2
2019-06-01 2.0.1
- Allow puppetlabs/stdlib 6.x
- Allow stm/file_capability 2.x
- Allow puppet/archive 4.x
2019-03-17 2.0.0
- Drop Puppet 3 support
- Add Puppet 6 support
- Allow specifying
$listener
as an array of listener hashes - Add
config_mode
parameter - Update systemd unit file
- Support Ubuntu 18.04
- Support enabling Web UI
- Update to vault 1.0.3
- Use stm/file_capability to manage file capabilities
- Use camptocamp/systemd to manage systemd unit file
2017-10-16 1.2.8
- Update to vault 0.8.3
2017-08-18 1.2.7
- Update to vault 0.8.1
2017-08-10 1.2.6
- Update to vault 0.8.0
2017-07-15 1.2.5
- Added
manage_service_file
option
2017-07-10 1.2.4
- Fix and update beaker tests
- Update to vault 0.7.3
2017-05-09 1.2.3
- Update to vault 0.7.2
2017-05-08 1.2.2
- Update to vault 0.7.1
2017-04-22 1.2.1
- Update to rspec 3.5
- Ruby 2.4 Fixnum deprecation
- Correctly set config dir owner and group as vault user
2017-03-27 v1.2.0
- Support Debian 7 and 8
- Update to vault 0.7.0
2017-03-13 v1.1.9
- Make download URL configuration more fine-grained
- Support upgrading when
version
changes and installing viaarchive
method
2017-02-13 v1.1.8
- Test with Puppet 4.9 by default
- Test with bleeding edge Puppet 4
- Allow legacy Puppet 3 builds to fail in CI
- Add
manage_service
option
2017-02-09 v1.1.7
- Update to vault 0.6.5
2017-01-21 v1.1.6
- Fix regression in vault_sorted_json
2017-01-10 v1.1.5
- Update to vault 0.6.4
2016-12-07 v1.1.4
- Update to vault 0.6.3
2016-11-04 v1.1.3
- Fix
cap_ipc_lock
for Debian/Ubuntu - Bump Puppet and Ruby versions used in CI
2016-11-03 v1.1.2
- Better code to ensure
cap_ipc_lock
is set
2016-10-10 v1.1.1
- Documentation fixes
2016-10-07 v1.1.0
- Update to vault 0.6.2
- Add
manage_backend_dir
option
2016-09-29 v1.0.0
- Replaced
config_hash
parameter for more fine grained controls - Replaced nanliu/staging for puppet/archive
- Allow for package-based install method
- Generate pretty JSON configs
2016-08-27 v0.4.0
- Update to vault 0.6.1
- Add Amazon OS support
2016-07-19 v0.3.0
- Ensure config.json has correct user/group
2016-06-01 v0.2.3
- Configure log file for upstart
- Update to vault 0.6.0
- Deploy to PuppetForge via TravisCI
2016-06-01 v0.2.2
- Update to vault 0.5.3
2016-03-17 v0.2.1
- Update to vault 0.5.2
2016-03-17 v0.2.0
- Add RedHat7/CentOS7 support (including
systemd
support) - Add
num_procs
option to controlGOMAXPROCS
in init scripts - RedHat6 SysV init script improvements
- Improved beaker acceptance tests
2016-03-15 v0.1.9
- Update to vault 0.5.1
- Add
manage_user
andmanage_group
params
2016-02-11 v0.1.8
- Update to vault 0.5.0
2016-01-14 v0.1.7
- Update to vault 0.4.1
2016-01-05 v0.1.6
- Update to vault 0.4.0
2016-01-05 v0.1.5
- Add CentOS 6 support
2015-10-14 v0.1.4
- Fixes syntax error in bad release v0.1.3
2015-10-14 v0.1.3
- Use new Fastly CDN for default
download_url
parameter
2015-10-14 v0.1.2
- Support specifying
service_provider
2015-10-06 v0.1.1
- Fixed issue #1, containment bug
2015-07-28 v0.1.0
- Initial relase
- Add support exclusively for Ubuntu 14.04
Dependencies
- puppetlabs-stdlib (>= 4.24.0 < 7.0.0)
- puppet-archive (>= 2.0.0 < 5.0.0)
- camptocamp-systemd (>= 1.1.1 < 3.0.0)
- stm-file_capability (>= 1.0.1 < 5.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.