Skip to content

Commit

Permalink
Merge pull request #11 from lsst-it/IT-2937/puppet7
Browse files Browse the repository at this point in the history
prefer new puppetserver 7 ca_crt.pem path
  • Loading branch information
jhoblitt authored Aug 23, 2022
2 parents ba226f6 + 6471bb6 commit a35527e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion exe/foreman_envsync
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ def foreman_org_ids
hammer_cmd_parse_one(cmd, field)
end

# prefer the puppetserver 7 ca_crt.pem path
def ssl_ca_file
%w[
/etc/puppetlabs/puppetserver/ca/ca_crt.pem
/etc/puppetlabs/puppet/ssl/ca/ca_crt.pem
].find { |f| File.exist?(f) }
end

def puppetserver_env_list
hostname = Socket.gethostname

Expand All @@ -112,7 +120,7 @@ def puppetserver_env_list
ssl_client_cert: cert_file("/etc/puppetlabs/puppet/ssl/certs/#{hostname}.pem"),
ssl_client_key: key_file("/etc/puppetlabs/puppet/ssl/private_keys/#{hostname}.pem"),
verify_ssl: true,
ssl_ca_file: "/etc/puppetlabs/puppet/ssl/ca/ca_crt.pem"
ssl_ca_file: ssl_ca_file
)

JSON.parse(res)["environments"].keys
Expand Down

0 comments on commit a35527e

Please sign in to comment.