Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for self signed certificate #107

Closed
clauded opened this issue Jun 15, 2015 · 1 comment
Closed

Support for self signed certificate #107

clauded opened this issue Jun 15, 2015 · 1 comment

Comments

@clauded
Copy link

clauded commented Jun 15, 2015

We use rundeck with foreman a we have a self signed certificate on the foreman server. We then use the foreman api to get the node list in rundeck. For this to work, we need to import the self-signed certificates in the truststore (the foreman CA and the foreman SSL cert). We also need to fix /etc/rundeck/profile. It would be nice to have a sub module to configure this. Right now we use the following code but it's not perfect as the rundeck module already manages the profile file.

Here's the code we used:

  file { '/root/foreman.local.pem':
    source  => "puppet:///modules/${module_name}/rundeck/foreman.local.pem",
    mode    => '0600',
    require => Class['rundeck'],
  }->
  exec { 'import-foreman-self-signed-certificates':
    command =>
      'keytool -import -alias foreman_cert -file /root/foreman.local.pem -keystore /etc/rundeck/ssl/truststore -storepass adminadmin -noprompt &&\
       keytool -import -alias foreman_ca -file /var/lib/puppet/ssl/certs/ca.pem -keystore /etc/rundeck/ssl/truststore -storepass adminadmin -noprompt',
    path    => '/usr/bin:/usr/sbin:/bin:/sbin',
    creates => '/etc/rundeck/ssl/truststore',
  }
  file_line { 'fix-etc-rdeck-ssl-opts':
    path    => '/etc/rundeck/profile',
    line    => 'export RDECK_SSL_OPTS="-Djavax.net.ssl.trustStore=/etc/rundeck/ssl/truststore -Djavax.net.ssl.trustStoreType=jks -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol"',
    match   => '^export\ RDECK_SSL_OPTS.*$',
    notify  => Class['rundeck::service'],
  }->
  file_line { 'fix-etc-rundeck-jvm':
    path    => '/etc/rundeck/profile',
    line    => 'export RDECK_JVM="$RDECK_JVM $RDECK_SSL_OPTS"',
    after   => '^export\ RDECK_SSL_OPTS.*$',
    notify  => Class['rundeck::service'],
  }
@clauded
Copy link
Author

clauded commented Jul 9, 2015

I found the following workaround so I'm closing the issue :

$truststore = '/etc/rundeck/ssl/truststore'
$truststore_password = 'adminadmin'
class { 'rundeck':
...
truststore => $truststore,
truststore_password => $truststore_password,
jvm_args => "-Xmx1024m -Xms256m -server -Djavax.net.ssl.trustStore=${truststore} -Djavax.net.ssl.trustStoreType=jks -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol",
...

@clauded clauded closed this as completed Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant