2023-01-19 16:15:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Dynamically configure /etc/puppet/cosmos-modules.conf
|
|
|
|
#
|
|
|
|
# The content of that file is chosen according to:
|
|
|
|
#
|
|
|
|
# 1. If the file is actually present in the model, use that.
|
2023-01-19 16:30:18 +00:00
|
|
|
# 2. If there is a script called /etc/puppet/setup_cosmos_modules, run that.
|
2023-01-19 16:15:37 +00:00
|
|
|
# 3. If the file still doesn't exist, create it with the defaults in this script.
|
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ -f "${COSMOS_MODEL}/overlay/etc/puppet/cosmos-modules.conf" ]; then
|
|
|
|
test "$COSMOS_VERBOSE" = "y" && \
|
|
|
|
echo "$0: /etc/puppet/cosmos-modules.conf is present in the model, exiting"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-01-19 16:30:18 +00:00
|
|
|
if [ -x /etc/puppet/setup_cosmos_modules ]; then
|
2023-01-19 16:15:37 +00:00
|
|
|
test "$COSMOS_VERBOSE" = "y" && \
|
2023-01-19 16:30:18 +00:00
|
|
|
echo "$0: Updating /etc/puppet/cosmos-modules.conf with /etc/puppet/setup_cosmos_modules"
|
|
|
|
/etc/puppet/setup_cosmos_modules
|
2023-01-19 16:15:37 +00:00
|
|
|
|
|
|
|
test -f /etc/puppet/cosmos-modules.conf && exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
test "$COSMOS_VERBOSE" = "y" && \
|
|
|
|
echo "$0: Creating/updating /etc/puppet/cosmos-modules.conf with defaults from this script"
|
|
|
|
|
|
|
|
cat > /etc/puppet/cosmos-modules.conf << EOF
|
|
|
|
# File created/updated by $0
|
|
|
|
#
|
|
|
|
concat puppetlabs/concat yes
|
|
|
|
stdlib puppetlabs/stdlib yes
|
|
|
|
#ufw attachmentgenie/ufw yes
|
|
|
|
#apt puppetlabs/apt yes
|
2023-01-19 16:56:51 +00:00
|
|
|
#cosmos https://github.com/SUNET/puppet-cosmos.git yes
|
2023-01-19 16:15:37 +00:00
|
|
|
EOF
|