You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.[Module Description - What does the module do?](#module-description)
10
9
3.[Setup - The basics of getting started with java_ks](#setup)
11
10
4.[Usage - The parameters available for configuration](#usage)
12
-
5.[Implementation - An under-the-hood peek at what the module is doing](#implementation)
11
+
5.[Reference - An under-the-hood peek at what the module is doing](#reference)
13
12
6.[Limitations - OS compatibility, etc.](#limitations)
14
13
7.[Development - Guide for contributing to the module](#development)
15
-
8.[Release Notes - Notes on the most recent updates to the module](#release-notes)
16
14
17
-
Overview
18
-
--------
15
+
##Overview
19
16
20
17
The java_ks module uses a combination of keytool and openssl to manage entries in a Java keystore.
21
18
22
-
Module Description
23
-
------------------
19
+
##Module Description
24
20
25
-
The java_ks module contains a type called 'java_ks' and a single provider named 'keytool'. Their purpose is to enable importation of arbitrary, already generated and signed certificates into a java keystore for use by various applications.
21
+
The java\_ks module contains a type called `java_ks` and a single provider named `keytool`. Their purpose is to enable importation of arbitrary, already generated and signed certificates into a Java keystore for use by various applications.
26
22
27
-
Setup
28
-
-----
29
-
30
-
**What java_ks affects:**
31
-
32
-
* keystore repositories
23
+
##Setup
33
24
34
25
### Beginning with java_ks
35
26
36
-
To use the java_ks module's functionality, declare each java_ks resource you need
This resource manages the entries in a java keystore, and uses composite namevars to accomplish the same alias spread across multiple target keystores.
27
+
To get started with java_ks, declare each `java_ks` resource you need.
67
28
68
-
**Parameters within java_ks**
29
+
~~~
30
+
java_ks { 'puppetca:truststore':
31
+
ensure => latest,
32
+
certificate => '/etc/puppet/ssl/certs/ca.pem',
33
+
target => '/etc/activemq/broker.ts',
34
+
password => 'puppet',
35
+
trustcacerts => true,
36
+
}
37
+
~~~
69
38
70
-
#### `certificate`
71
39
72
-
An already-signed certificate to place in the keystore. This file must be present on the node before java_ks{} is run.
40
+
##Usage
73
41
74
-
To have a java application server use a specific certificate for incoming connections, you will need to simultaneously import the private key accompanying the signed certificate you want to use. As long as you provide the path to the key and the certificate, the provider will do the conversion for you.
42
+
You must specify a target in some way. You can specify `target` after the colon in the title or by using the target attribute in the resource. If you declare both, it will prefer the attribute.
75
43
76
-
#### `chain`
44
+
~~~
45
+
java_ks { 'puppetca:keystore':
46
+
ensure => latest,
47
+
certificate => '/etc/puppet/ssl/certs/ca.pem',
48
+
target => '/etc/activemq/broker.ks',
49
+
password => 'puppet',
50
+
trustcacerts => true,
51
+
}
77
52
78
-
Some java applications do not properly send intermediary certificate authorities. In these cases, you can bundle them with the server certificate using this chain parameter. This file must be present on the node before java_ks{} is run.
To have a Java application server use a specific certificate for incoming connections, use the certificate parameter. You will need to simultaneously import the private key accompanying the signed certificate you want to use. As long as you provide the path to the key and the certificate, the provider will do the conversion for you.
87
63
88
-
#### `ensure`
89
64
90
-
The `ensure` parameter accepts three attributes: absent, present, and latest. Latest verifies md5 certificate fingerprints for the stored certificate and the source file.
91
-
92
-
#### `password`
65
+
### Namevars
93
66
94
-
The password used to protect the keystore. If private keys are also protected, this password will be used to attempt to unlock them.
67
+
The java_ks module supports multiple certificates with different keystores but the same alias by implementing Puppet's composite namevar functionality. Titles map to namevars via `$alias:$target` (alias of certificate, colon, on-disk path to the keystore). If you create dependencies on these resources you need to remember to use the same title syntax outlined for generating the composite namevars.
95
68
96
-
#### `password_file`
69
+
*Note about composite namevars:*
70
+
The way composite namevars currently work, you must have the colon in the title. This is true *even if you define name and target parameters.* The title can be `foo:bar`, but the name and target parameters must be `broker.example.com` and `/etc/activemq/broker.ks`. If you follow convention, it will do as you expect and correctly create an entry in the
71
+
broker.ks keystore with the alias of broker.example.com.
97
72
98
-
Used as an alternative to `password` here you can specify a plaintext file where the password is stored.
73
+
##Reference
99
74
100
-
#### `path`
75
+
###Public Types
76
+
*`java_ks`: This resource manages the entries in a Java keystore, and uses composite namevars to accomplish the same alias spread across multiple target keystores.
101
77
102
-
The search path used for command (keytool, openssl) execution. Paths can be specified as an array or as a file path seperated list (for example : in linux).
78
+
###Public Providers
79
+
*`keytool`: Uses a combination of the binaries `openssl` and `keytool` to manage Java keystores
103
80
104
-
#### `private_key`
81
+
####Parameters
82
+
All parameters, except where specified, are optional.
105
83
106
-
If you want an application to be a server and encrypt traffic, you will need a private key. Private key entries in a keystore must be accompanied by a signed certificate for the keytool provider. This file must be present on the node before java_ks{} is run.
84
+
#####`certificate`
85
+
*Required.* Places an already-signed certificate in the keystore. This will autorequire the specified file and must be present on the node before java_ks{} is run.
86
+
Valid options: string. Default: undef.
107
87
108
-
#### `target`
88
+
#####`chain`
89
+
Bundles intermediary certificate authorities with certificate authorities. This autorequires the file of the same path and must be present on the node before java_ks{} is run.
90
+
Valid options: string. Default: undef.
109
91
110
-
Destination file for the keystore. We autorequire the parent directory for convenience.
92
+
#####`ensure`
93
+
Valid options: absent, present, latest. Latest verifies md5 certificate fingerprints for the stored certificate and the source file. Default: present.
111
94
112
-
#### `trustcacerts`
95
+
#####`name`
96
+
*Required.* Identifies the entry in the keystore. This will be converted to lowercase.
97
+
Valid options: string. Default: undef.
113
98
114
-
Certificate authorities input into a keystore aren’t trusted by default, so if you are adding a CA you need to set this parameter to true.
99
+
#####`password`
100
+
Used to protect the keystore. If private keys are also protected, this password will be used to attempt to unlock them.
101
+
Valid options: String. Must be 6 or more characters. This cannot be used together with `password_file`, but *you must pass at least one of these parameters.* Default: undef.
115
102
116
-
### Namevars
103
+
#####`password_file`
104
+
A plaintext file where the password is stored. Used as an alternative to `password`. This cannot be used together with `password`, but *you must pass at least one of these parameters.*
105
+
Valid options: String to the plaintext file. Default: undef.
117
106
118
-
Java_ks supports multiple certificates with different keystores but the same alias by implementing Puppet's composite namevar functionality. Titles map to namevars via `$alias:$target` (alias of certificate, colon, on-disk path to the keystore). If you create dependencies on these resources you need to remember to use the same title syntax outlined for generating the composite namevars.
107
+
#####`path`
108
+
Used for command (keytool, openssl) execution.
109
+
Valid options: array or file path separated list (for example : in linux). Default: undef.
119
110
120
-
*Note about composite namevars:*
121
-
The way composite namevars currently work, you must have the colon in the title. This is true *even if you define name and target parameters.* The title can be `foo:bar`, but the name and target parameters must be `broker.example.com` and `/etc/activemq/broker.ks`. If you follow convention, it will do as you expect and correctly create an entry in the broker.ks keystore with the alias of broker.example.com.
111
+
#####`private_key`
112
+
A private key that encrypts traffic to a server application. Must be accompanied by a signed certificate for the keytool provider. This will autorequire the specified file and must be present on the node before java_ks{} is run.
113
+
Valid options: string. Default: undef.
122
114
123
-
Implementation
124
-
--------------
115
+
#####`target`
116
+
*Required.* Destination file for the keystore. Autorequires the parent directory of the file.
117
+
Valid options: string. Default: undef.
125
118
126
-
### keytool
119
+
#####`trustcacerts`
120
+
Certificate authorities input into a keystore aren’t trusted by default, so if you are adding a CA you need to set this parameter to true.
121
+
Valid options: 'true' or 'false'. Default: 'false'
127
122
128
-
Keytool is a provider that uses a combination of the binaries openssl and keytool to manage Java keystores
129
123
130
124
Limitations
131
125
------------
@@ -139,8 +133,7 @@ Developed against IBM Java 6 on AIX. Other versions may be unsupported.
139
133
Development
140
134
-----------
141
135
142
-
Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
143
-
144
-
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
136
+
Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad hardware, software, and deployment configurations that Puppet is intended to serve.
145
137
146
-
You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing)
138
+
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. For more information, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html)
0 commit comments