summaryrefslogtreecommitdiff
path: root/global/overlay/etc/puppet/facter/cosmos.rb
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2014-06-30 11:49:48 +0200
committerLeif Johansson <leifj@sunet.se>2014-06-30 11:49:48 +0200
commitdeff549e038885729868b30c68a12538883c9646 (patch)
tree26e7ff03a8baf9e3bfd2fff5edb90e23ba7a1dc5 /global/overlay/etc/puppet/facter/cosmos.rb
parenta1bc104e5bd63ab896afc92781df6aac6efd90e3 (diff)
parentecb417e8ce9a1eca586e2169c615c2bd30c938f8 (diff)
Merge branch 'master' of git.nordu.net:sunet-opssunet-ops-2014-06-30-v02
Diffstat (limited to 'global/overlay/etc/puppet/facter/cosmos.rb')
-rw-r--r--global/overlay/etc/puppet/facter/cosmos.rb22
1 files changed, 22 insertions, 0 deletions
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
+