diff options
author | Fredrik Thulin <fredrik@thulin.net> | 2014-05-26 12:25:09 +0200 |
---|---|---|
committer | Fredrik Thulin <fredrik@thulin.net> | 2014-05-26 12:25:09 +0200 |
commit | 288276144724476f0ed6b716fea8b512f46b68e6 (patch) | |
tree | 71a341359de603632f4d6d3f5f29b376fd532d5b /global/overlay/etc/puppet/facter/cosmos.rb | |
parent | b4b1247f99d5daf07b2a8dca45c8dcac63e8ba55 (diff) |
sync from eduid-opssunet-ops-2014-05-26-v04sunet-ops-2014-05-26-v03
Diffstat (limited to 'global/overlay/etc/puppet/facter/cosmos.rb')
-rw-r--r-- | global/overlay/etc/puppet/facter/cosmos.rb | 22 |
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 + |