File salt-supportconfig-1.2.3.obscpio of Package supportutils-plugin-salt.37117
07070100000000000081A40000000000000000000000016780FB8C00000D58000000000000000000000000000000000000002900000000salt-supportconfig-1.2.3/CONTRIBUTING.md# Contributing
## Pull Requests
The following roles exist in the context of a Pull Request:
- Creator
- Reviewer
- Collaborators
The guidelines noted here describe the expectations that should be met when submitting a Pull request.
### Pull Request Creators
1. Please fill out the Pull Request template.
2. Please provide a description for someone not familiar with your code changes to be still able to understand your changes in the context of the project.
3. Please enable the reviewer with the provided information in the description to understand the PR without opening any external resources like bug reports.
4. Please ensure that before hitting the "Create" button on GitHub you have read and understood the `CONTRIBUTING.md` and linked GitHub Wiki pages.
5. Please ensure all automation on GitHub receives a positive result checkmark.
6. Please state in a comment why a negative result - if occurring - is incorrect or not your fault.
7. Please use the GitHub functionality of re-requesting a review in case you haven't gotten a review after a reasonable time.
8. Please re-request a review in case you made substantial changes to the Pull Request.
9. Please write detailed and meaningful commit messages. Avoid the usage of generic messages like "fix bug". Further information can be found here:
- https://cbea.ms/git-commit/
- https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/
### Pull Request Reviewers
As a Pull Request Reviewer, the most important point is that the Creator is following the points above. In the case that there are things that haven't been followed please kindly ask the Creator to change that. This should also be done for the rest of the contributing guidelines in this document.
Once the points above are fulfilled there are a number of things that should be taken care of:
1. Check that the style guides that cannot be automatically enforced, are fulfilled.
2. Verify that the description of the Pull Request matches the code that was submitted.
3. Check that the submitted changes make sense in the context of the project and branch. A not acceptable example would be a feature backport after the target branch was already declared end of life.
4. Verify that the new and modified test cases are useful to the codebase.
5. Check that you can understand the code. If you don't understand it the likelihood of a required change is almost given.
Optionally you additionally do the following things as well:
1. If you have a better or different approach to fix the problem, please feel free to point it out. The suggestions shouldn't cause the PR to not be merged.
2. If you have informal comments or nitpicks, please submit them as early as possible and mark them as such accordingly. Informal comments and nitpicks shouldn't cause the PR to not be merged.
Very important during the whole process is that a reviewer should encourage more contributions by the author. Good things should be highlighted and should make the Pull Request Creator feel appraised.
Finally, if your review is completed and all required suggestions have been followed, please provide approval so PR can be merged.
Use these guidelines, but feel free to go beyond the points listed here if you have the capacity.
### Pull Request Collaborators
Please communicate respectfully with each another. So far no extra guidelines have been created for Collaborators.
07070100000001000081A40000000000000000000000016780FB8C0000042B000000000000000000000000000000000000002100000000salt-supportconfig-1.2.3/LICENSEThe MIT License (MIT)
Copyright (c) 2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
07070100000002000081A40000000000000000000000016780FB8C00000069000000000000000000000000000000000000002300000000salt-supportconfig-1.2.3/README.md# salt-supportconfig
Plugins for SUSE Supportconfig that are manages Salt data for a better debugging.
07070100000003000081A40000000000000000000000016780FB8C00000006000000000000000000000000000000000000002100000000salt-supportconfig-1.2.3/VERSION1.2.3
07070100000004000041ED0000000000000000000000026780FB8C00000000000000000000000000000000000000000000001D00000000salt-supportconfig-1.2.3/src07070100000005000041ED0000000000000000000000026780FB8C00000000000000000000000000000000000000000000002600000000salt-supportconfig-1.2.3/src/pluginrc07070100000006000081ED0000000000000000000000016780FB8C00000543000000000000000000000000000000000000003500000000salt-supportconfig-1.2.3/src/pluginrc/saltplugins.rc#!/bin/bash
function check_packages() {
for pkg in "$@"; do
if ! rpm -q $pkg 2> /dev/null; then
echo "ERROR: Salt package \"$pkg\" is not installed"
echo
return 1
fi
done
}
function check_packages_failhard() {
if ! check_packages "$@"; then
exit 111
fi
}
function validate_rpm_pkg() {
OUT=$(rpm -V $1 2>&1)
[[ $? == 0 ]] && echo "Status: Passed" || echo "Status: $OUT"
}
#
# Define compatibility functions with old systems (SLE12)
#
# If new function isn't defined, each function discards
# the output file, and passes the rest of arguments to
# the equivalent old function. Otherwise, new function
# is assumed to be correctly defined as per the
# supportconfig.rc file
#
if [[ ! $(type -t log_entry) == function ]]; then
function log_entry() {
section_header "${@:2}"
}
fi
if [[ ! $(type -t log_cmd) == function ]]; then
function log_cmd() {
plugin_command "${@:2}"
}
fi
if [[ ! $(type -t log_write) == function ]]; then
function log_write() {
plugin_message "${@:2}"
}
fi
if [[ ! $(type -t conf_files) == function ]]; then
function conf_files() {
pconf_files "${@:2}"
}
fi
if [[ ! $(type -t log_files) == function ]]; then
function log_files() {
plog_files "${@:2}"
}
fi07070100000007000081ED0000000000000000000000016780FB8C000006D9000000000000000000000000000000000000002F00000000salt-supportconfig-1.2.3/src/saltconfiguration#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for Salt
# Description: List Salt jobs
# License: GPLv2
# Author: Bo Maryniuk <bo@suse.de>
# Written: 2016 Oct 28
#############################################################
SVER=0.1.0
OF="plugin-saltconfiguration.txt"
for RCFILE in $(ls /usr/lib/supportconfig/resources/*.rc); do
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
done
#
# Get Salt config file.
# Remove all the comments via parsing it.
#
function get_salt_config() {
cnf=$1
if /usr/lib/venv-salt-minion/bin/python3 -c "import yaml" 2>1; then
PYTHON=/usr/lib/venv-salt-minion/bin/python3
elif python3 -c "import yaml" 2>1; then
PYTHON=python3
elif python -c "import yaml" 2>1; then
PYTHON=python
elif python2 -c "import yaml" 2>1; then
PYTHON=python2
else
echo "Please install yaml for python."
return
fi
OUTPUT=$($PYTHON -c "import yaml;print(yaml.dump(yaml.safe_load(open('$cnf')) or 'N/A', default_flow_style=False))")
# Remove possible passwords
echo "$OUTPUT" | sed -e 's/\(.*pass:\).*/\1 *REMOVED BY SUPPORTCONFIG*/g;s/\(.*password:\).*/\1 *REMOVED BY SUPPORTCONFIG*/g'
}
check_packages "salt" || check_packages_failhard "venv-salt-minion"
log_entry $OF "Supportconfig Plugin for SaltStack, v${SVER}"
for cfg_file in $(ls /etc/salt/* /etc/salt/*.d/*conf /etc/venv-salt-minion/* /etc/venv-salt-minion/*.d/*conf); do
if [ -f $cfg_file ]; then
echo "Content of the config: $cfg_file"
echo "--------------------------------"
get_salt_config $cfg_file
echo -e "--------------------------------\n"
fi
done
07070100000008000081ED0000000000000000000000016780FB8C0000052C000000000000000000000000000000000000002900000000salt-supportconfig-1.2.3/src/saltgeneral#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for Salt
# Description: Gathers important troubleshooting information
# about SaltStack (general)
# License: GPLv2
# Author: Bo Maryniuk <bo@suse.de>
# Written: 2016 Oct 28
#############################################################
SVER=0.1.0
OF="plugin-saltgeneral.txt"
for RCFILE in $(ls /usr/lib/supportconfig/resources/*.rc); do
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
done
log_entry $OF note "Supportconfig Plugin for SaltStack, v${SVER}"
for pkg_name in "salt" "salt-master" "salt-api" "salt-minion" "venv-salt-minion" "salt-syndic" "salt-proxy"; do
printf "#==[ Validating %-15s ]====================#\n" $pkg_name
validate_rpm_pkg $pkg_name
done
for i in "salt-master" "salt-api" "salt-minion" "venv-salt-minion"; do
log_cmd $OF "rc$i status"
done
if [ -e /etc/machine-id ]; then
conf_files $OF /etc/machine-id
elif [ -e /var/lib/dbus/machine-id ]; then
conf_files $OF /var/lib/dbus/machine-id
else
log_write $OF "no machine id found"
fi
if [ -e /usr/bin/venv-salt-call ]; then
log_cmd $OF "venv-salt-call --local grains.items"
else
log_cmd $OF "salt-call --local grains.items"
fi
07070100000009000081ED0000000000000000000000016780FB8C00000292000000000000000000000000000000000000002600000000salt-supportconfig-1.2.3/src/saltjobs#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for Salt
# Description: List Salt jobs
# License: GPLv2
# Author: Bo Maryniuk <bo@suse.de>
# Written: 2016 Oct 28
#############################################################
SVER=0.1.0
OF="plugin-saltjobs.txt"
for RCFILE in $(ls /usr/lib/supportconfig/resources/*.rc); do
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
done
check_packages_failhard "salt" "salt-master"
log_entry $OF "Supportconfig Plugin for SaltStack, v${SVER}"
log_cmd $OF "salt-run jobs.list_jobs --out=yaml"
0707010000000A000081ED0000000000000000000000016780FB8C000002DC000000000000000000000000000000000000002A00000000salt-supportconfig-1.2.3/src/saltlogfiles#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for Salt
# Description: Salt logfiles
# License: GPLv2
# Author: Michael Calmer <mc@suse.de>
# Written: 2017 Apr 23
#############################################################
SVER=0.1.0
OF="plugin-saltlogfiles.txt"
for RCFILE in $(ls /usr/lib/supportconfig/resources/*.rc); do
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
done
log_entry $OF "Supportconfig Plugin for Salt, v${SVER}"
log_files $OF 1000 /var/log/salt/minion /var/log/venv-salt-minion.log /var/log/salt/master /var/log/salt/key /var/log/salt/broker /var/log/salt/api /var/log/salt/ssh
0707010000000B000081ED0000000000000000000000016780FB8C000005E4000000000000000000000000000000000000002F00000000salt-supportconfig-1.2.3/src/saltmasterpillars#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for Salt
# Description: Extract Salt pillars
# License: GPLv2
# Author: Bo Maryniuk <bo@suse.de>
# Written: 2016 Oct 28
#############################################################
SVER=0.1.0
OF="plugin-saltmasterpillars.txt"
for RCFILE in $(ls /usr/lib/supportconfig/resources/*.rc); do
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
done
#
# Get all pillars
#
function get_salt_master_pillars() {
if python3 -c "import yaml" 2>1; then
PYTHON=python3
elif python -c "import yaml" 2>1; then
PYTHON=python
elif python2 -c "import yaml" 2>1; then
PYTHON=python2
else
echo "Please install yaml for python."
return
fi
for cfg_file in $(ls /etc/salt/master /etc/salt/master.d/*conf); do
for pillar_dir in $($PYTHON -c \
"import yaml;print(' '.join(yaml.safe_load(open('$cfg_file')).get('pillar_roots', {}).get('base', [])))"); do
if [ -d $pillar_dir ] && [ "$(ls -A $pillar_dir)" ]; then
for pillar_file in $(find $pillar_dir -type f); do
echo "Content of the pillar $pillar_file:"
echo "--------------------"
cat $pillar_file
echo -e "--------------------\n\n"
done
fi
done
done
}
check_packages_failhard "salt" "salt-master"
log_entry $OF "Supportconfig Plugin for SaltStack, v${SVER}"
get_salt_master_pillars
0707010000000C000081ED0000000000000000000000016780FB8C0000028E000000000000000000000000000000000000002D00000000salt-supportconfig-1.2.3/src/saltminionskeys#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for Salt
# Description: Lists keys of Salt minions
# License: GPLv2
# Author: Bo Maryniuk <bo@suse.de>
# Written: 2016 Oct 28
#############################################################
SVER=0.1.0
OF="plugin-saltminionskeys.txt"
for RCFILE in $(ls /usr/lib/supportconfig/resources/*.rc); do
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
done
check_packages_failhard "salt" "salt-master"
log_entry $OF "Supportconfig Plugin for SaltStack, v${SVER}"
log_cmd $OF "salt-key -L"
0707010000000D000081ED0000000000000000000000016780FB8C00000359000000000000000000000000000000000000002F00000000salt-supportconfig-1.2.3/src/saltminionsstatus#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for Salt
# Description: Gathers minions status
# License: GPLv2
# Author: Bo Maryniuk <bo@suse.de>
# Written: 2016 Oct 28
#############################################################
SVER=0.1.0
OF="plugin-saltminionsstatus.txt"
for RCFILE in $(ls /usr/lib/supportconfig/resources/*.rc); do
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
done
check_packages_failhard "salt" "salt-master"
log_entry $OF "Supportconfig Plugin for SaltStack, v${SVER}"
# List of what minions are actually present according to the master
log_cmd $OF "salt-run manage.list_state"
# ...and the opposite
log_cmd $OF "salt-run manage.list_not_state"
# Joined minions
log_cmd $OF "salt-run manage.joined"
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!31 blocks