Skip to content

Commit fd6a114

Browse files
author
Morgan Haskel
committed
Merge pull request #113 from jtappa/readme-edits
reorganized README, markdown styling, grammar, and descriptions
2 parents a4fa766 + 35f58ba commit fd6a114

File tree

1 file changed

+79
-86
lines changed

1 file changed

+79
-86
lines changed

README.md

Lines changed: 79 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
java_ks
2-
=======
1+
#java_ks
32

43
[![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-java_ks.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-java_ks)
54

@@ -9,123 +8,118 @@ java_ks
98
2. [Module Description - What does the module do?](#module-description)
109
3. [Setup - The basics of getting started with java_ks](#setup)
1110
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)
1312
6. [Limitations - OS compatibility, etc.](#limitations)
1413
7. [Development - Guide for contributing to the module](#development)
15-
8. [Release Notes - Notes on the most recent updates to the module](#release-notes)
1614

17-
Overview
18-
--------
15+
##Overview
1916

2017
The java_ks module uses a combination of keytool and openssl to manage entries in a Java keystore.
2118

22-
Module Description
23-
------------------
19+
##Module Description
2420

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.
2622

27-
Setup
28-
-----
29-
30-
**What java_ks affects:**
31-
32-
* keystore repositories
23+
##Setup
3324

3425
### Beginning with java_ks
3526

36-
To use the java_ks module's functionality, declare each java_ks resource you need
37-
38-
java_ks { 'puppetca:truststore':
39-
ensure => latest,
40-
certificate => '/etc/puppet/ssl/certs/ca.pem',
41-
target => '/etc/activemq/broker.ts',
42-
password => 'puppet',
43-
trustcacerts => true,
44-
}
45-
46-
java_ks { 'puppetca:keystore':
47-
ensure => latest,
48-
certificate => '/etc/puppet/ssl/certs/ca.pem',
49-
target => '/etc/activemq/broker.ks',
50-
password => 'puppet',
51-
trustcacerts => true,
52-
}
53-
54-
java_ks { 'broker.example.com:/etc/activemq/broker.ks':
55-
ensure => latest,
56-
certificate => '/etc/puppet/ssl/certs/broker.example.com.pe-internal-broker.pem',
57-
private_key => '/etc/puppet/ssl/private_keys/broker.example.com.pe-internal-broker.pem',
58-
password => 'puppet',
59-
}
60-
61-
Usage
62-
-----
63-
64-
### java_ks
65-
66-
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.
6728

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+
~~~
6938

70-
#### `certificate`
7139

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
7341

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.
7543

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+
}
7752
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.
53+
java_ks { 'broker.example.com:/etc/activemq/broker.ks':
54+
ensure => latest,
55+
certificate => '/etc/puppet/ssl/certs/broker.example.com.pe-internal-broker.pem',
56+
private_key => '/etc/puppet/ssl/private_keys/broker.example.com.pe-internal-broker.pem',
57+
password => 'puppet',
58+
}
59+
~~~
7960

80-
java_ks { 'broker.example.com:/etc/activemq/broker.jks':
81-
ensure => latest,
82-
certificate => '/etc/ssl/certs/broker.example.com.pem',
83-
private_key => '/etc/ssl/private/broker.example.com.key',
84-
chain => '/etc/ssl/certs/GlobalSign_Intermediate_CA.pem
85-
password => 'puppet',
86-
}
61+
### Certificates
62+
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.
8763

88-
#### `ensure`
8964

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
9366

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.
9568

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.
9772

98-
Used as an alternative to `password` here you can specify a plaintext file where the password is stored.
73+
##Reference
9974

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.
10177

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
10380

104-
#### `private_key`
81+
####Parameters
82+
All parameters, except where specified, are optional.
10583

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.
10787

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.
10991

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.
11194

112-
#### `trustcacerts`
95+
#####`name`
96+
*Required.* Identifies the entry in the keystore. This will be converted to lowercase.
97+
Valid options: string. Default: undef.
11398

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.
115102

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.
117106

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.
119110

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.
122114

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.
125118

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'
127122

128-
Keytool is a provider that uses a combination of the binaries openssl and keytool to manage Java keystores
129123

130124
Limitations
131125
------------
@@ -139,8 +133,7 @@ Developed against IBM Java 6 on AIX. Other versions may be unsupported.
139133
Development
140134
-----------
141135

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.
145137

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)
139+

0 commit comments

Comments
 (0)