Gitlab Community Edition Instance

Skip to content
Snippets Groups Projects
90-puppet-info 976 B
Newer Older
#!/bin/bash

if [ ! -r /etc/puppet/puppet.conf ]; then exit 0; fi

MASTER=$(sed -n '/^server/s/^.*=\(.*\)/\1/p' /etc/puppet/puppet.conf | tr -d '[:space:]')
PORT=$(sed -n '/^masterport/s/^.*=\(.*\)/\1/p' /etc/puppet/puppet.conf | tr -d '[:space:]')
ENVIRONMENT=$(sed -n '/^environment/s/^.*=\(.*\)/\1/p' /etc/puppet/puppet.conf | tr -d '[:space:]')

echo "** Dieser Host wird per Puppet verwaltet. **
   Der Puppet Agent kann gesteuert werden mit:
      puppet agent --disable [\"<grund>\"]
      puppet agent --enable"

if [ -f /var/lib/puppet/state/agent_disabled.lock ]; then
  echo
  echo " ## Der Puppet-Agent ist zur Zeit deaktiviert, Grund: \"$(sed -n 's/{"disabled_message":"\(.*\)"}/\1/p' /var/lib/puppet/state/agent_disabled.lock)\""
  echo
fi

if [ ! -z $MASTER ]; then
  echo -e -n "\n** Puppetserver:\t\t$MASTER"
  if [ ! -z $PORT ]; then
    echo -n ":$PORT"
  fi
fi

if [ ! -z $ENVIRONMENT ]; then
  echo -e "\n** Puppet Environment:\t\t$ENVIRONMENT\n"
fi