From 02d31e08862e42dc2fa46f16eb4e3e5e15fc05ff Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 28 Jul 2017 16:30:41 +0200 Subject: Update global/overlay/etc/puppet/ from nunoc-ops. --- global/overlay/etc/puppet/facter/cosmos.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 global/overlay/etc/puppet/facter/cosmos.rb (limited to 'global/overlay/etc/puppet/facter') diff --git a/global/overlay/etc/puppet/facter/cosmos.rb b/global/overlay/etc/puppet/facter/cosmos.rb new file mode 100644 index 0000000..d810082 --- /dev/null +++ b/global/overlay/etc/puppet/facter/cosmos.rb @@ -0,0 +1,22 @@ +# +# Extract local Cosmos configuration +# +require 'facter' +Facter.add(:cosmos_repo) do + setcode do + Facter::Util::Resolution.exec("sh -c '. /etc/cosmos/cosmos.conf && echo $COSMOS_REPO'") + end +end + +Facter.add(:cosmos_tag_pattern) do + setcode do + Facter::Util::Resolution.exec("sh -c '. /etc/cosmos/cosmos.conf && echo $COSMOS_UPDATE_VERIFY_GIT_TAG_PATTERN'") + end +end + +Facter.add(:cosmos_repo_origin_url) do + setcode do + Facter::Util::Resolution.exec("sh -c '. /etc/cosmos/cosmos.conf && cd $COSMOS_REPO && git remote show -n origin | grep \"Fetch URL\" | awk \"{print \\$NF }\"'") + end +end + -- cgit v1.1