Skip to content

Commit

Permalink
Add key_content parameter for offline install
Browse files Browse the repository at this point in the history
* Custom key source/content for Debian (apt module) is
  required in order to allow rabbitmq being installed
  by Puppet for intranet only faced hosts as well as
  internet faced ones.
  It also elliminates a hardcode for URL which is a kind of
  SPOF and 'limitation' for operators' freedom of choose.

* Update docs as well

DocImpact
Implements improvement: #MODULES-1408

Signed-off-by: Bogdan Dobrelya <[email protected]>

Fix package_gpg_key key_source and docs

* Reuse package_gpg_key for apt as well
* Update/add docs for package_gpg_key, key_source
* Fix key_source usage in repo::apt

Signed-off-by: Bogdan Dobrelya <[email protected]>
  • Loading branch information
Bogdan Dobrelya committed Oct 24, 2014
1 parent cbda1ce commit 88fae89
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ class { '::rabbitmq':
}
```

Or such as offline installation from intranet or local mirrors:

```puppet
class { '::rabbitmq':
key_content => template('openstack/rabbit.pub.key'),
package_gpg_key => '/tmp/rabbit.pub.key',
}
```

And this one will use external package key source for any (apt/rpm) package provider:

```puppet
class { '::rabbitmq':
package_gpg_key => 'http://www.some_site.some_domain/some_key.pub.key',
}
```

### Environment Variables
To use RabbitMQ Environment Variables, use the parameters `environment_variables` e.g.:

Expand Down Expand Up @@ -205,6 +222,11 @@ RabbitMQ Environment Variables in rabbitmq_env.config

The erlang cookie to use for clustering - must be the same between all nodes.

###`key_content`

Uses content method for Debian OS family. Should be a template for apt::source
class. Overrides `package_gpg_key` behavior, if enabled. Undefined by default.

####`ldap_auth`

Boolean, set to true to enable LDAP auth.
Expand Down Expand Up @@ -248,7 +270,10 @@ be changed to latest.

####`package_gpg_key`

RPM package GPG key to import.
RPM package GPG key to import. Uses source method. Should be a URL for Debian/RedHat
OS family, or a file name for RedHat OS family.
Set to http://www.rabbitmq.com/rabbitmq-signing-key-public.asc by default.
Note, that `key_content`, if specified, would override this parameter for Debian OS family.

####`package_name`

Expand Down
9 changes: 7 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
$environment_variables = $rabbitmq::params::environment_variables,
$config_variables = $rabbitmq::params::config_variables,
$config_kernel_variables = $rabbitmq::params::config_kernel_variables,
$key_content = undef,
) inherits rabbitmq::params {

validate_bool($admin_enable)
Expand Down Expand Up @@ -122,8 +123,12 @@
case $::osfamily {
'RedHat', 'SUSE':
{ include '::rabbitmq::repo::rhel' }
'Debian':
{ include '::rabbitmq::repo::apt' }
'Debian': {
class { '::rabbitmq::repo::apt' :
key_source => $package_gpg_key,
key_content => $key_content,
}
}
default:
{ }
}
Expand Down
2 changes: 2 additions & 0 deletions manifests/repo/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$include_src = false,
$key = '056E8E56',
$key_source = 'http://www.rabbitmq.com/rabbitmq-signing-key-public.asc',
$key_content = undef,
) {

$pin = $rabbitmq::package_apt_pin
Expand All @@ -21,6 +22,7 @@
include_src => $include_src,
key => $key,
key_source => $key_source,
key_content => $key_content,
}

if $pin {
Expand Down

0 comments on commit 88fae89

Please sign in to comment.