pe_rbac 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 003e9ccdbe211c50b4025335831bcaab7c77d4cf
4
- data.tar.gz: 40d72b46ffd84a8b9976d81eba7bf93f23e92e65
3
+ metadata.gz: 0f77d4b61e7a7c630244c5ffc50313bf9239100f
4
+ data.tar.gz: 45c6bbb55280efbd810320257712c662150383a1
5
5
  SHA512:
6
- metadata.gz: 5c05146edfa1e4d4eb2392f774699c834388d836d546b34d1aebef2e638f2375b6e3799e317013de34d9dd511b372c95b5730bc12061ba225bee42c26712ed1c
7
- data.tar.gz: fec01c7aae9f104627bc7bd02ba77fa87544a2d53b6d44306adb96010d1060046d40071d96cdf3a7fe927e0d6c431daa3ed07e621b469fac48a7e5fbf0bf162f
6
+ metadata.gz: 9aa9257686040018bb92e43a657a5c9c49e6cd10b7991cd84af4a6bd01f3b40ebbfc1c40b9f199c1763f4a341373f19adcedf8116fb5331f723ce0347f799491
7
+ data.tar.gz: d9260d27ccbe0925670f9359a8d74c30c9a307eabe156c39b57b831226fce6b958123454b91e642a0bd0207eec62eea2e73049234247cbc24b71279411769003
data/README.md CHANGED
@@ -6,6 +6,11 @@ TODO: Delete this and the text above, and describe your gem
6
6
 
7
7
  ## Installation
8
8
 
9
+ Gem dependencies need G++ amongst other things. Easiest way to proceed:
10
+ ```
11
+ yum groupinstall 'Development Tools'
12
+ ```
13
+
9
14
  Add this line to your application's Gemfile:
10
15
 
11
16
  ```ruby
data/exe/pe_rbac CHANGED
@@ -3,7 +3,7 @@ require 'pe_rbac'
3
3
  require 'escort'
4
4
 
5
5
  Escort::App.create do |app|
6
- app.version "0.0.1"
6
+ app.version PeRbac::VERSION
7
7
  app.summary "pe_rbac"
8
8
  app.description "create RBAC users and install tokens"
9
9
 
@@ -1,3 +1,3 @@
1
1
  module PeRbac
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/pe_rbac.rb CHANGED
@@ -5,11 +5,28 @@ require 'json'
5
5
 
6
6
  module PeRbac
7
7
  ssldir = '/etc/puppetlabs/puppet/ssl'
8
+ fqdn = %x(facter fqdn).strip
9
+ pe_old_pk = "#{ssldir}/private_keys/pe-internal-orchestrator.pem"
10
+ pe_old_cert = "#{ssldir}/certs/pe-internal-orchestrator.pem"
11
+ pe_new_pk = "#{ssldir}/private_keys/#{fqdn}.pem"
12
+ pe_new_cert = "#{ssldir}/certs/#{fqdn}.pem"
13
+
14
+ # pe 2016.4.0 removes the pe-internal-orchestrator.pem file but old systems
15
+ # will still have the client cert (which won't work), so pick based on
16
+ # using pe-internal-orchestrator.pem if its available
17
+ if File.exist?(pe_old_pk)
18
+ pk = pe_old_pk
19
+ cert = pe_old_cert
20
+ else
21
+ pk = pe_new_pk
22
+ cert = pe_new_cert
23
+ end
24
+
8
25
  CONF = {
9
26
  host: Socket.gethostname,
10
27
  port: 4433,
11
- cert: ssldir + '/certs/pe-internal-orchestrator.pem',
12
- key: ssldir + '/private_keys/pe-internal-orchestrator.pem',
28
+ cert: cert,
29
+ key: pk,
13
30
  cacert: ssldir + '/certs/ca.pem'
14
31
  }
15
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pe_rbac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler