From 77301e8a2accf45c1e9cd55b60e9caf720a20155 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Feb 2022 21:52:01 +0100 Subject: modules/: Add module certregen. --- .../production/modules/certregen/lib/facter/has_puppet.rb | 10 ++++++++++ .../production/modules/certregen/lib/facter/hostcrl.rb | 4 ++++ .../production/modules/certregen/lib/facter/localcacert.rb | 4 ++++ 3 files changed, 18 insertions(+) create mode 100644 code/environments/production/modules/certregen/lib/facter/has_puppet.rb create mode 100644 code/environments/production/modules/certregen/lib/facter/hostcrl.rb create mode 100644 code/environments/production/modules/certregen/lib/facter/localcacert.rb (limited to 'code/environments/production/modules/certregen/lib/facter') diff --git a/code/environments/production/modules/certregen/lib/facter/has_puppet.rb b/code/environments/production/modules/certregen/lib/facter/has_puppet.rb new file mode 100644 index 0000000..05f2e80 --- /dev/null +++ b/code/environments/production/modules/certregen/lib/facter/has_puppet.rb @@ -0,0 +1,10 @@ +Facter.add(:has_puppet) do + setcode do + begin + require 'puppet' + true + rescue LoadError + false + end + end +end diff --git a/code/environments/production/modules/certregen/lib/facter/hostcrl.rb b/code/environments/production/modules/certregen/lib/facter/hostcrl.rb new file mode 100644 index 0000000..1d69a66 --- /dev/null +++ b/code/environments/production/modules/certregen/lib/facter/hostcrl.rb @@ -0,0 +1,4 @@ +Facter.add(:hostcrl) do + confine :has_puppet => true + setcode { Puppet[:hostcrl] } +end diff --git a/code/environments/production/modules/certregen/lib/facter/localcacert.rb b/code/environments/production/modules/certregen/lib/facter/localcacert.rb new file mode 100644 index 0000000..278ca8b --- /dev/null +++ b/code/environments/production/modules/certregen/lib/facter/localcacert.rb @@ -0,0 +1,4 @@ +Facter.add(:localcacert) do + confine :has_puppet => true + setcode { Puppet[:localcacert] } +end -- cgit v1.2.3