mirror of https://github.com/zulip/zulip.git
puppet: add zulipconf function for reading settings from zulip.conf.
This makes it convenient for us to have optional user-defined settings in the main Zulip puppet configuration.
This commit is contained in:
parent
98ae0516d2
commit
63c757eac3
|
@ -0,0 +1,12 @@
|
||||||
|
module Puppet::Parser::Functions
|
||||||
|
newfunction(:zulipconf, :type => :rvalue) do |args|
|
||||||
|
default = args.pop
|
||||||
|
joined = args.join(" ")
|
||||||
|
output = `/usr/bin/crudini --get /etc/zulip/zulip.conf #{joined} 2>&1`; result=$?.success?
|
||||||
|
if result
|
||||||
|
output
|
||||||
|
else
|
||||||
|
default
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -19,7 +19,7 @@ VIRTUALENV_NEEDED="${VIRTUALENV_NEEDED:-yes}"
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get -y dist-upgrade $APT_OPTIONS
|
apt-get -y dist-upgrade $APT_OPTIONS
|
||||||
apt-get install -y puppet git python python-six $ADDITIONAL_PACKAGES
|
apt-get install -y puppet git python python-six crudini $ADDITIONAL_PACKAGES
|
||||||
|
|
||||||
# Create and activate a virtualenv
|
# Create and activate a virtualenv
|
||||||
if [ "$VIRTUALENV_NEEDED" = "yes" ]; then
|
if [ "$VIRTUALENV_NEEDED" = "yes" ]; then
|
||||||
|
|
Loading…
Reference in New Issue