From: Frank Brehm Date: Fri, 9 Feb 2024 14:30:30 +0000 (+0100) Subject: Moved files from rot into special dirs X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=b413514eb723bd07415196f4067d0bd7f2b1c6e8;p=pixelpark%2Fpuppetmaster-webhooks.git Moved files from rot into special dirs --- diff --git a/babel.ini b/babel.ini deleted file mode 100644 index d7dfdfd..0000000 --- a/babel.ini +++ /dev/null @@ -1,5 +0,0 @@ -# Extraction from Python source files -[python: **.py] - -[python: bin/*] - diff --git a/bin/get-forge-modules b/bin/get-forge-modules new file mode 100755 index 0000000..4c9c0b9 --- /dev/null +++ b/bin/get-forge-modules @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import os +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.get_forge_modules import GetForgeModulesApp + +MY_APPNAME = my_path.stem +LOG = logging.getLogger(MY_APPNAME) + +app = GetForgeModulesApp(appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 1: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/bin/get-module-changes b/bin/get-module-changes new file mode 100755 index 0000000..044bbe0 --- /dev/null +++ b/bin/get-module-changes @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import os +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.get_module_changes import GetModuleChangesApp + +MY_APPNAME = my_path.stem +LOG = logging.getLogger(MY_APPNAME) + +app = GetModuleChangesApp(appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 2: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/bin/update_puppet5_env b/bin/update_puppet5_env new file mode 100755 index 0000000..d5dc73a --- /dev/null +++ b/bin/update_puppet5_env @@ -0,0 +1,71 @@ +#!/bin/bash + +set -e +set -u + +PUPPET_CONF="/etc/puppetlabs/puppet/puppet.conf" +CERTNAME=$(cat /etc/puppetlabs/puppet/puppet.conf | \ + grep -P -v '^\s*#' | \ + grep -P -v '^\s*$' | \ + grep -P -o '^\s*certname(\s|=).*' | \ + awk -F'=' '{print $2}' | \ + sed -e 's/^[ ]*//' -e 's/[ ]*$//') +if [[ -z "${CERTNAME}" ]] ; then + CERTNAME=$(hostname -f) +fi + +echo +echo "###########################################" +echo "Current node: '${CERTNAME}'" +echo + +envs=$( ls -1 /etc/puppetlabs/code/environments ) +if [[ "$#" != "0" ]] ; then + envs="$*" +fi + +for env in ${envs} ; do + + env_dir="/etc/puppetlabs/code/environments/${env}" + + echo + echo "###########################################" + echo "Performing environment '${env}' ..." + echo "###########################################" + echo + + + cmd="/opt/puppetlabs/puppet/bin/r10k deploy environment \"${env}\" -v -p" + echo "${cmd}" + eval ${cmd} + + + if [[ -d "${env_dir}" ]] ; then + echo + sleep 1 + + cmd="/usr/bin/curl -i" + cmd+=" --cert /etc/puppetlabs/puppet/ssl/certs/${CERTNAME}.pem" + cmd+=" --key /etc/puppetlabs/puppet/ssl/private_keys/${CERTNAME}.pem" + cmd+=" --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem" + cmd+=" -X DELETE" + cmd+=" \"https://${CERTNAME}:8140/puppet-admin-api/v1/environment-cache?environment=${env}\"" + + echo "${cmd}" + eval ${cmd} + + else + echo -e "\nEnvironment-Verzeichnis '${env_dir}' existiert nicht." >&2 + fi + + cmd="/opt/puppetlabs/puppet/bin/puppet generate types --environment \"${env}\"" + echo "${cmd}" + eval ${cmd} + + echo + echo "Finished environment '${env}'." + sleep 1 + +done + +# vim: ts=4 et list diff --git a/cgi-bin/deploy.py b/cgi-bin/deploy.py new file mode 100755 index 0000000..be941c9 --- /dev/null +++ b/cgi-bin/deploy.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.deploy import WebhookDeployApp # noqa + +MY_APPNAME = my_path.stem +LOG = logging.getLogger(MY_APPNAME) + +app = WebhookDeployApp(appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 2: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/cgi-bin/r10k_hook.py b/cgi-bin/r10k_hook.py new file mode 100755 index 0000000..1cf1999 --- /dev/null +++ b/cgi-bin/r10k_hook.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.r10k import R10kHookApp # noqa + +MY_APPNAME = my_path.stem.replace('_', '-') +LOG = logging.getLogger(MY_APPNAME) + +app = R10kHookApp(appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 2: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/cgi-bin/show-env-html.py b/cgi-bin/show-env-html.py new file mode 100755 index 0000000..ebbbb2c --- /dev/null +++ b/cgi-bin/show-env-html.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.show_env import ShowEnvApp # noqa + +MY_APPNAME = my_path.stem +LOG = logging.getLogger(MY_APPNAME) + +app = ShowEnvApp(output_type='html', appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 2: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/cgi-bin/show-env.py b/cgi-bin/show-env.py new file mode 100755 index 0000000..3c656d3 --- /dev/null +++ b/cgi-bin/show-env.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.show_env import ShowEnvApp # noqa + +MY_APPNAME = my_path.stem +LOG = logging.getLogger(MY_APPNAME) + +app = ShowEnvApp(output_type='txt', appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 2: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/cgi-bin/show-modules-html.py b/cgi-bin/show-modules-html.py new file mode 100755 index 0000000..56ff57b --- /dev/null +++ b/cgi-bin/show-modules-html.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.show_modules import ShowModulesApp # noqa + +MY_APPNAME = my_path.stem +LOG = logging.getLogger(MY_APPNAME) + +app = ShowModulesApp(output_type='html', appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 2: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/cgi-bin/show-modules-txt.py b/cgi-bin/show-modules-txt.py new file mode 100755 index 0000000..07fe102 --- /dev/null +++ b/cgi-bin/show-modules-txt.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.show_modules import ShowModulesApp # noqa + +MY_APPNAME = my_path.stem +LOG = logging.getLogger(MY_APPNAME) + +app = ShowModulesApp(output_type='txt', appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 2: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/cgi-bin/show-modules.py b/cgi-bin/show-modules.py new file mode 100755 index 0000000..d6ccae5 --- /dev/null +++ b/cgi-bin/show-modules.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Standard modules +import sys +import logging + +from pathlib import Path + +# own modules: +my_path = Path(__file__) +my_real_path = my_path.resolve() +base_dir = my_real_path.parent +libdir = base_dir.joinpath('lib') + +sys.path.insert(0, str(libdir)) + +from webhooks.show_modules import ShowModulesApp # noqa + +MY_APPNAME = my_path.stem +LOG = logging.getLogger(MY_APPNAME) + +app = ShowModulesApp(appname=MY_APPNAME, base_dir=base_dir) + +if app.verbose > 2: + LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) + +app() + +sys.exit(0) + +# vim: ts=4 et diff --git a/deploy.py b/deploy.py deleted file mode 100755 index be941c9..0000000 --- a/deploy.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.deploy import WebhookDeployApp # noqa - -MY_APPNAME = my_path.stem -LOG = logging.getLogger(MY_APPNAME) - -app = WebhookDeployApp(appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 2: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/deploy.yaml b/deploy.yaml deleted file mode 100644 index 6393d27..0000000 --- a/deploy.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# May be overridden by /etc/pixelpark/deploy.yaml -verbose: 0 -do_sudo: true -log_dir: '/var/log/webhooks' -default_email: 'puppet@pixelpark.com' -default_parent_dir: '/etc/puppetlabs/code/fileserver' -smtp_server: 'localhost' -smtp_port: 25 -ignore_projects: [] -mail_cc_addresses: [] -sender_address: 'Puppetmaster ' -projects: - hiera: - namespace: 'puppet' - name: 'hiera' - parent_dir: '/etc/puppetlabs/code' - branch: 'master' - workdir: 'hiera-data' - postfix_config: - namespace: 'ppadmin' - name: 'postfix_config' - workdir: 'postfix_config' - branch: 'master' - -mail_bodies: - special_chars: "Received special characters in module name" - no_branch_dir: "Branch folder does not exist" - no_modules_dir: "Modules folder does not exist" - git_access_denied: "Access to remote repository was denied" - diff --git a/etc/babel.ini b/etc/babel.ini new file mode 100644 index 0000000..d7dfdfd --- /dev/null +++ b/etc/babel.ini @@ -0,0 +1,5 @@ +# Extraction from Python source files +[python: **.py] + +[python: bin/*] + diff --git a/etc/deploy.yaml b/etc/deploy.yaml new file mode 100644 index 0000000..6393d27 --- /dev/null +++ b/etc/deploy.yaml @@ -0,0 +1,31 @@ +--- +# May be overridden by /etc/pixelpark/deploy.yaml +verbose: 0 +do_sudo: true +log_dir: '/var/log/webhooks' +default_email: 'puppet@pixelpark.com' +default_parent_dir: '/etc/puppetlabs/code/fileserver' +smtp_server: 'localhost' +smtp_port: 25 +ignore_projects: [] +mail_cc_addresses: [] +sender_address: 'Puppetmaster ' +projects: + hiera: + namespace: 'puppet' + name: 'hiera' + parent_dir: '/etc/puppetlabs/code' + branch: 'master' + workdir: 'hiera-data' + postfix_config: + namespace: 'ppadmin' + name: 'postfix_config' + workdir: 'postfix_config' + branch: 'master' + +mail_bodies: + special_chars: "Received special characters in module name" + no_branch_dir: "Branch folder does not exist" + no_modules_dir: "Modules folder does not exist" + git_access_denied: "Access to remote repository was denied" + diff --git a/etc/get-forge-modules.yaml b/etc/get-forge-modules.yaml new file mode 100644 index 0000000..c0cfca5 --- /dev/null +++ b/etc/get-forge-modules.yaml @@ -0,0 +1,6 @@ +--- + +puppet_env_dir: '/etc/puppetlabs/code/environments' +forge_uri: 'https://forgeapi.puppet.com/v3/modules' +http_timeout: 30 + diff --git a/etc/hooks.yaml b/etc/hooks.yaml new file mode 100644 index 0000000..397962d --- /dev/null +++ b/etc/hooks.yaml @@ -0,0 +1,14 @@ +--- +#verbose: 0 +#no_error_mail: true +#do_sudo: true +#log_dir: '/var/log/webhooks' +#default_email: 'puppet@pixelpark.com' +#default_parent_dir: '/etc/puppetlabs/code' +#smtp_server: 'localhost' +#smtp_port: 25 +#mail_cc_addresses: [] +#sender_address: 'Puppetmaster ' +#data_dir: '/var/lib/webhooks' +# Relative to data_dir +#cachefile: 'modules-info.yaml' diff --git a/etc/r10k-hook.yaml b/etc/r10k-hook.yaml new file mode 100644 index 0000000..40ca9b7 --- /dev/null +++ b/etc/r10k-hook.yaml @@ -0,0 +1,2 @@ +--- +simulate: False diff --git a/get-forge-modules b/get-forge-modules deleted file mode 100755 index 4c9c0b9..0000000 --- a/get-forge-modules +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import os -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.get_forge_modules import GetForgeModulesApp - -MY_APPNAME = my_path.stem -LOG = logging.getLogger(MY_APPNAME) - -app = GetForgeModulesApp(appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 1: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/get-forge-modules.yaml b/get-forge-modules.yaml deleted file mode 100644 index c0cfca5..0000000 --- a/get-forge-modules.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -puppet_env_dir: '/etc/puppetlabs/code/environments' -forge_uri: 'https://forgeapi.puppet.com/v3/modules' -http_timeout: 30 - diff --git a/get-module-changes b/get-module-changes deleted file mode 100755 index 044bbe0..0000000 --- a/get-module-changes +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import os -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.get_module_changes import GetModuleChangesApp - -MY_APPNAME = my_path.stem -LOG = logging.getLogger(MY_APPNAME) - -app = GetModuleChangesApp(appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 2: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/hooks.yaml b/hooks.yaml deleted file mode 100644 index 397962d..0000000 --- a/hooks.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -#verbose: 0 -#no_error_mail: true -#do_sudo: true -#log_dir: '/var/log/webhooks' -#default_email: 'puppet@pixelpark.com' -#default_parent_dir: '/etc/puppetlabs/code' -#smtp_server: 'localhost' -#smtp_port: 25 -#mail_cc_addresses: [] -#sender_address: 'Puppetmaster ' -#data_dir: '/var/lib/webhooks' -# Relative to data_dir -#cachefile: 'modules-info.yaml' diff --git a/r10k-hook.yaml b/r10k-hook.yaml deleted file mode 100644 index 40ca9b7..0000000 --- a/r10k-hook.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -simulate: False diff --git a/r10k_hook.py b/r10k_hook.py deleted file mode 100755 index 1cf1999..0000000 --- a/r10k_hook.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.r10k import R10kHookApp # noqa - -MY_APPNAME = my_path.stem.replace('_', '-') -LOG = logging.getLogger(MY_APPNAME) - -app = R10kHookApp(appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 2: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/show-env-html.py b/show-env-html.py deleted file mode 100755 index ebbbb2c..0000000 --- a/show-env-html.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.show_env import ShowEnvApp # noqa - -MY_APPNAME = my_path.stem -LOG = logging.getLogger(MY_APPNAME) - -app = ShowEnvApp(output_type='html', appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 2: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/show-env.py b/show-env.py deleted file mode 100755 index 3c656d3..0000000 --- a/show-env.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.show_env import ShowEnvApp # noqa - -MY_APPNAME = my_path.stem -LOG = logging.getLogger(MY_APPNAME) - -app = ShowEnvApp(output_type='txt', appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 2: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/show-modules-html.py b/show-modules-html.py deleted file mode 100755 index 56ff57b..0000000 --- a/show-modules-html.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.show_modules import ShowModulesApp # noqa - -MY_APPNAME = my_path.stem -LOG = logging.getLogger(MY_APPNAME) - -app = ShowModulesApp(output_type='html', appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 2: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/show-modules-txt.py b/show-modules-txt.py deleted file mode 100755 index 07fe102..0000000 --- a/show-modules-txt.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.show_modules import ShowModulesApp # noqa - -MY_APPNAME = my_path.stem -LOG = logging.getLogger(MY_APPNAME) - -app = ShowModulesApp(output_type='txt', appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 2: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/show-modules.py b/show-modules.py deleted file mode 100755 index d6ccae5..0000000 --- a/show-modules.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Standard modules -import sys -import logging - -from pathlib import Path - -# own modules: -my_path = Path(__file__) -my_real_path = my_path.resolve() -base_dir = my_real_path.parent -libdir = base_dir.joinpath('lib') - -sys.path.insert(0, str(libdir)) - -from webhooks.show_modules import ShowModulesApp # noqa - -MY_APPNAME = my_path.stem -LOG = logging.getLogger(MY_APPNAME) - -app = ShowModulesApp(appname=MY_APPNAME, base_dir=base_dir) - -if app.verbose > 2: - LOG.debug("{c} object:\n{o}".format(c=app.__class__.__name__, o=app)) - -app() - -sys.exit(0) - -# vim: ts=4 et diff --git a/update_puppet5_env b/update_puppet5_env deleted file mode 100755 index d5dc73a..0000000 --- a/update_puppet5_env +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -set -e -set -u - -PUPPET_CONF="/etc/puppetlabs/puppet/puppet.conf" -CERTNAME=$(cat /etc/puppetlabs/puppet/puppet.conf | \ - grep -P -v '^\s*#' | \ - grep -P -v '^\s*$' | \ - grep -P -o '^\s*certname(\s|=).*' | \ - awk -F'=' '{print $2}' | \ - sed -e 's/^[ ]*//' -e 's/[ ]*$//') -if [[ -z "${CERTNAME}" ]] ; then - CERTNAME=$(hostname -f) -fi - -echo -echo "###########################################" -echo "Current node: '${CERTNAME}'" -echo - -envs=$( ls -1 /etc/puppetlabs/code/environments ) -if [[ "$#" != "0" ]] ; then - envs="$*" -fi - -for env in ${envs} ; do - - env_dir="/etc/puppetlabs/code/environments/${env}" - - echo - echo "###########################################" - echo "Performing environment '${env}' ..." - echo "###########################################" - echo - - - cmd="/opt/puppetlabs/puppet/bin/r10k deploy environment \"${env}\" -v -p" - echo "${cmd}" - eval ${cmd} - - - if [[ -d "${env_dir}" ]] ; then - echo - sleep 1 - - cmd="/usr/bin/curl -i" - cmd+=" --cert /etc/puppetlabs/puppet/ssl/certs/${CERTNAME}.pem" - cmd+=" --key /etc/puppetlabs/puppet/ssl/private_keys/${CERTNAME}.pem" - cmd+=" --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem" - cmd+=" -X DELETE" - cmd+=" \"https://${CERTNAME}:8140/puppet-admin-api/v1/environment-cache?environment=${env}\"" - - echo "${cmd}" - eval ${cmd} - - else - echo -e "\nEnvironment-Verzeichnis '${env_dir}' existiert nicht." >&2 - fi - - cmd="/opt/puppetlabs/puppet/bin/puppet generate types --environment \"${env}\"" - echo "${cmd}" - eval ${cmd} - - echo - echo "Finished environment '${env}'." - sleep 1 - -done - -# vim: ts=4 et list