Playbooks On Rails (PORS) Generated: 2026-03-17
A graphical interface to ease splunk tasks
Loading...
Searching...
No Matches
pors.sh File Reference

PORS is an UI for managing your whole Splunk infrastructure with Ansible. More...

Functions

 F_LOG (1, 2)
 Logging function.
 F_ECHOLOG (1, 2)
 Logging function which also echo's to the terminal.
 F_LOGROTATE ()
 Rotates the PORS log.
 F_LOGROTATESIZE ()
 Rotates the PORS log by size.
 F_RMVAULTPW (1)
 removes the temporary Ansible Vault pw file
 F_ENDSESS ()
 Clear session.
 F_EXIT ()
 regular PORS exit
 F_EXITUNCLEAN (1)
 exit the program unclean but controlled
 F_ABIN (1, 2, 3, 4, 5)
 start ansible-playbook
 F_DIALOG ()
 main dialog form with PORS presets
 F_HELP ()
 Usage/Help for PORS.
 F_SHOWAPPS (1)
 Deprecated way of parsing and showing apps<->target.
 F_LISTAPPS (1)
 Parse and show apps<->target links.
 F_RMAPP ()
 Removes an app <--> target linkage.
 F_SELECTOR ()
 Menu for selecting all or specific targets.
 F_GOAPPS ()
 show current apps deployment
 F_HOSTFILE (1)
 Choose / check ansible inventory file.
 F_TARGETS (1, 2)
 identify targets/hosts of a group
 F_GVARDIR ()
 group_vars dir check and initiate if needed
 F_DEPLSYSC ()
 deploy system/local configs
 F_SSHORNOT ()
 let the user choose to either catch existing conf from another host or locally (system/local related)
 F_DIMPORT (1, 2, 3, 4)
 import by ssh from an existing host (system/local related)
 F_DBROWSE ()
 file browser (system/local related)
 F_LOCSRC (1)
 List and choose local repository files.
 F_EXPANDHOSTS (1, 2, 3)
 create an expanded list of hostnames
 F_VALCONF ()
 validate a dir if it contains conf files (system/local related)
 F_CLEANCONF ()
 delete empty conf files (system/local related)
 F_DIAERR ()
 dialog box providing errorcode
 F_DIAERR_A (1:, 2:)
 display a dialog error box using automatic height/width
 F_ERRLOG (1, 2, 3)
 dialog box very similar to F_DIAERR but givin an option to display a given logfile
 F_WAITBOX (1:)
 display a wait box (very useful when something is done in the background)
 F_MSGLEN (1)
 calculate the length and height of a message
 F_SETREPODIR ()
 Set the local repository variable in PORS.
 F_ENAPP ()
 links an app for a host/target in PORS
 F_FETCHGITREPOS (1:)
 get all available git repos
 F_MSG ()
 Just showing a simple message box param 1: required: message to show param 2: optional: window width param 3: optional: window height.
 F_TPLUPDATE ()
 updating target dirs based on the template dir
 F_APPTPLUPDATE (1, 2, 3)
 updating target dirs based on the APP template dir
 F_PULLSYSC ()
 pull system/local configs for remote server (system/local related)
 F_SHOWHOSTS ()
 shows hostnames in an expanded target group
 F_CHOOSEENV ()
 show available target environments to the user and let the user select one
 F_EDITSYSC ()
 manage local conf files (system/local related)
 F_SHELPER ()
 shelper UI
 F_CALCTGROUP (1, 2, 3)
 create a temporary target group with selected hosts
 F_NOGROUPUNIQ (1, 2)
 remove all group tags from a hosts file
 F_SPLACT ()
 splunk action/task/command
 F_SHEXEC ()
 splunkhelper actions
 F_SHUPGRADE ()
 install/upgrade/use shelper
 F_GETAPICREDS ()
 ask for splunk_user and splunk_password vars - DEPRECATED - use VAULT instead
 F_LISTSPLREPO (1)
 Lists splunk versions in the local repo.
 F_DLSPLUNK (1)
 Downloads a specific splunk release.
 F_GETSTAGEDSPL (1)
 Get the current staged splunk version.
 F_STAGESPL (1, 2)
 Stage a specific splunk version from the local repository.
 F_UPGRADESPLC ()
 WIP - upgrading splunk cluster env.
 F_DLLOGSTREAM ()
 Downloads a specific cribl logstream release.
 F_GETSTAGEDLS ()
 Get the current staged cribl logstream version.
 F_LISTCRIBLREPO ()
 Lists cribl packages in the local repo.
 F_STAGELS (1)
 Stage a specific cribl logstream version from the local repository.
 F_SELHOST (1, 2)
 Show and choose host(s).
 F_INSTALLSPL (1)
 Install splunk on ansible prepared servers.
 F_INSTALLLOGSTREAM ()
 Install cribl logstream on ansible prepared servers.
 F_CONFLOGSTREAM (1:)
 Configures cribl logstream on ansible prepared servers.
 F_ADDSERVICEUSER (1, 2, 3)
 Creates the OS_SERVICE_USER linux user account and add any extra groups needed.
 F_ADDSYSUSER (1, 2, 3)
 Creates a linux user account and add it to a group.
 F_UPGRADEMENU (1)
 A submenu for upgrade tasks.
 F_UPGRADE (1, 2)
 Upgrade splunk|logstream.
 F_GUIDEDUPGRADE (1, 2)
 Guided upgrade of splunk|logstream on multiple servers at once (sequentiel and ordered).
 F_DEPLOYMENU ()
 A submenu for app deployment tasks.
 F_DEPLOYAPP ()
 Deploy Apps to (a) specified target(s).
 F_CLUSTER ()
 Indexer cluster menu.
 F_VMMENU ()
 Menu for doing VM tasks.
 F_CONFMENU ()
 Configure splunk server roles.
 F_DEPLOYKEY (1, 2)
 Deploy a splunk server key to one or multiple targets.
 F_ADDDEP ()
 Configures splunk to be a SHC Deployer.
 F_ADDLM ()
 Configures splunk to be a LicenseMaster.
 F_ADDMN ()
 Configures splunk to be a MasterNode.
 F_GETSITES ()
 Get all configured sites from a host file.
 F_GETGROUPS ()
 Get all configured groups for the current environment.
 F_ADDMC ()
 Configures a new peer as MonitoringConsole.
 F_ADDDS ()
 Configures a new peer as SearchHead DeploymentServer.
 F_ADDSHCMEMBER ()
 Configures a new peer as SearchHead Cluster Member.
 F_ADDPEER ()
 Configures a new peer to an existing indexer cluster.
 F_ADDSH ()
 Configures splunk to be a SearchHead.
 F_ADDHF ()
 Configures splunk to be a Heavy Forwarder.
 F_VAULTPW ()
 Ask for the Vault password if required.
 F_VSPHERE_VCDEFS ()
 Collects every PORS relevant vCenter information.
 F_VSPHERE_VCGETINFO ()
 Collects and sets every PORS relevant vCenter information.
 F_VSPHERE_SELDS (VCDSLIST, VMDISKDEV, VMDISKMNTP, VMDISKSIZEGB)
 Select a datastore of a given vCenter.
 F_VSPHERE_DEPLOY (1, 2)
 Deploys the vSphere VM.
 F_VSPHERE_DISKADD (1, 2, 3)
 TODO/WIP Adds a new disk to a vSphere managed VM.
 F_VSPHERE_DISKSETUP (1, 2, 3, 4, 5)
 TODO/WIP Formats a partition in a VM incl. setting it up.
 F_DEPLOYVM ()
 Deploy a new blank VM based on a template.
 F_CALCCIDR (1)
 Calculates the CIDR of a given netmask.
 F_CALCNETMASK (1)
 Calculates the NETMASK of a given CIDR.
 F_STARTVMDEP (1)
 Deploy a new blank VM based on a template.
 F_GOOGLECP_DEPLOY (1)
 Deploys a VM in GCP.
 F_PROXMOX_DEPLOY (1)
 Deploys a system to Proxmox VE.
 F_FORMATDISK (1, 2)
 Formats a new added disk of a system.
 F_ADDDISK (1, 2)
 Add a new disk to a system.
 F_BASEINSTALL (1, 2)
 Doing/Ensure the base is as we want it.
 F_SYSUPGRADE (1, 2)
 system upgrade tasks
 F_SYSREBOOT (1, 2, 2)
 reboots a remote system
 F_CHECKSSH (1, 2)
 system upgrade tasks
 F_GETANSIBLEVAR (1, 2)
 request the value of an ansible variable
 F_PORSACTION (1, 2)
 Do internal PORS actions when triggered.
 F_DATAGIT ()
 Check pors_data directory -> git connection.
 F_DATACHANGED ()
 Check if pors_data directory contain changes.
 F_DATACOMMIT (1, 2)
 Commit changes within pors_data directory.
 F_DATAPUSH ()
 Push committed pors_data changes (if enabled).
 F_PING (1)
 Checks if a target answers to a ping.
 F_BACKUP_SPLUNK ()
 start a splunk backup
 F_MENUMAIN ()
 the main menu window of PORS in regular mode
 F_MENUTESTING ()
 the main menu window of PORS in testing mode
 F_MENUADVANCED ()
 the main menu window of PORS in advanced mode
 F_CHECKVERSION ()
 Checks for Ansible version and compares it with the required one.

Variables

Exported String NCURSES_NO_UTF8_ACS = 1
 ensure PuttY will not look ugly
Exported String DEBUG = $DEBUG
Exported String RUNMODE = "interactive"
 PORS can run in several modes this sets the default.
Exported String OS_SERVICE_USER =
 An (optional) service account username.
Exported String PYTHONUNBUFFERED = 1
 avoid buffering when exec python code (ansible)
String BIN = ${0##*/}
 auto generate the binary name without path
String REQAVERSION = "2.8.0"
 The minimal required Ansible version.
String WORKDIR = "$MYHOME"
 The working directory where all run files will be stored.
String ADIR = "/opt/pors"
 auto generate the path name of the bin
String DATADIR = "/opt/pors_data"
 the PORS data directory
String ALOG = "$DATADIR/audit/action.log"
 The PORS action log tracks any actions taken.
String ALOGMAXMB = 10
 The PORS action log max size in MB before rotating.
String AINVENTORY = "$DATADIR/inventories"
 Ansible inventories directory.
String DEFAULTSYML = ${ADIR}/roles/defaults/main.yml
 full path to roles/defaults/main.yml
String KICKUSER = N
 Default setting for overtaken a running session.
String APATH = "/usr/bin"
 The path to the regular ansible playbook binary.
String ABIN = "$APATH/ansible-playbook"
 The ansible playbook binary name.
String VBIN = "/usr/bin/ansible-vault"
 The full path to the regular ansible-vault binary.
String LOGDIR = ${WORKDIR}/logs
 The log directory.
String LOG = ${LOGDIR}/$(date +%F_%H-%M)_${BIN}.log
 The log file.
String MAXLOG = 7
 How many log files are allowed before rotate starts.
String AEUSRHOSTFILE = ${WORKDIR}/ae_current_hostfile
 the user choosen hostfile will be written into this file
String PLAYNOISE = "-vv"
 Verbosity level of playbooks.
String EDITBIN = /usr/bin/vim
 The editor which will be used e.g. when editing system/local files.
String PBDIR = "$ADIR/playbooks"
 The directory where all playbooks are expected (base path).
String PBDIRCRIBL = "$PBDIR/cribl"
 The directory where all CRIBL playbooks are expected.
String PBDIRSHELPER = "$PBDIR/shelper"
 The directory where all shelper playbooks are expected.
String PBDIRSPLUNK = "$PBDIR/splunk"
 The directory where all splunk playbooks are expected.
String PBDIRVMWARE = "$PBDIR/vmware"
 The directory where all vmware playbooks are expected.
String PBDIRSYSTEM = "$PBDIR/system"
 The directory where all system playbooks are expected.
String PBDIRGOOGLECP = "$PBDIR/googlecp"
 The directory where all GCP playbooks are expected.
String PBDIRPROXMOX = "$PBDIR/proxmox"
 The directory where all PVE playbooks are expected.
String PBDIRLOCAL = "$PBDIR/local"
 playbooks for local (i.e. ansible) itself
String ROLEDIR = "$ADIR/roles"
 The directory where all roles are expected.
String PBENAPP = ${PBDIRSPLUNK}/ae_enable_app.yml
 Adding/Linking new app(s) to PORS.
String PBREGENDEPLOY = ${PBDIRSPLUNK}/ae_recreate_deploy.yml
 Regenerate ae_deploy_apps.yml.
String PBDEPLAPP = ae_deploy_apps.yml
 Deploy apps to given targets.
String PBDEPLSYSC = ${PBDIRSPLUNK}/ae_deploy_systemconfigs.yml
 Deploy system/local configs to given targets.
String PBGETTARGETS = ${PBDIRSPLUNK}/ae_get_targets.yml
 Parsing inventories file and create an expanded host list for each target.
String PBUPGRADE = ${PBDIRSPLUNK}/ae_upgrade_splunk.yml
 Upgrade splunk.
String PBSPLBACKUP = ${PBDIRSPLUNK}/backup_splunk.yml
 Initiating a splunk backup, manually and during a splunk upgrade.
String PBSHINSTALL = ${PBDIRSHELPER}/ae_install_shelper.yml
 Install/Upgrade the splunk helper.
String SHOWAPPS = ${ADIR}/ae_show_app_deploymentstate.sh
 Show app deployment state by target(s) and type (local, git, ...).
String PBSHRELOAD = ${PBDIRSYSTEM}/ae_shelper_reload.yml
 Execute splunk helper tasks.
String PBSPLACT = ${PBDIRSPLUNK}/splunk_actions.yml
 Maintenance tasks for splunk.
String PBINSTALL = ${PBDIRSPLUNK}/ae_install_splunk.yml
 Install splunk.
String PBINSTALLLOGSTREAM = ${PBDIRCRIBL}/ae_install_logstream.yml
 Install cribl logstream.
String PBCONFLOGSTREAM = ${PBDIRCRIBL}/configure_logstream.yml
 Configure cribl logstream.
String PBUPGRADELOGSTREAM = ${PBDIRCRIBL}/ae_upgrade_logstream.yml
 Upgrade cribl logstream.
String PBCONFMN = ${PBDIRSPLUNK}/ae_configure_masternode.yml
 Configures splunk as a master node.
String PBCONFLM = ${PBDIRSPLUNK}/configure_licensemaster.yml
 Configures splunk as a license master.
String PBCONFDS = ${PBDIRSPLUNK}/configure_deploymentserver.yml
 Configures splunk as a deploymentserver.
String PBCONFMC = ${PBDIRSPLUNK}/configure_monitoringconsole.yml
 Configures splunk as a Monitoring Console.
String PBDEPLMONKEY = ${PBDIRSPLUNK}/deploy_monitoringkeys.yml
 Deploys the MonitoringConsole key for monitoring given targets.
String PBCONFMONROLES = ${PBDIRSPLUNK}/configure_monitoringroles.yml
 (Re-)configure the MonitoringConsole roles
String PBCONFPEER = ${PBDIRSPLUNK}/ae_configure_ix_peernode.yml
 Configures splunk as a peernode.
String PBCONFSHCM = ${PBDIRSPLUNK}/configure_shcmember.yml
 Configures splunk as a SHC member.
String PBCONFSH = ${PBDIRSPLUNK}/ae_configure_searchhead.yml
 Configures splunk as a searchhead.
String PBCONFDEP = ${PBDIRSPLUNK}/configure_deployer.yml
 Configures splunk as a SHC deployer.
String PBCONFHF = ${PBDIRSPLUNK}/ae_configure_heavyforwarder.yml
 Configures splunk as a heavy forwarder.
String INSTDEF = splunk_installation.yml
 splunk installation conf
String PBDLSPL = ${PBDIRSPLUNK}/ae_download_splunk.yml
 Downloader for splunk tar's.
String INSTDEFLS = logstream_installation.yml
 cribl logstream installation conf
String PBDLLOGSTREAM = ${PBDIRCRIBL}/ae_download_logstream.yml
 Downloader for cribl logstream.
String PBGHFETCHREPOS = "${PBDIRSPLUNK}/github_get_repos.yml"
 Fetch all accessible github repos.
String PBGLFETCHREPOS = "${PBDIRSPLUNK}/gitlab_get_repos.yml"
 Fetch all accessible gitlab repos.
String PBGETGROUPS = "${PBDIRLOCAL}/get_inventory_groups.yml"
 Fetch all accessible ansible groups for the current environment.
String PBVCINFO = "${PBDIRVMWARE}/vcenter_get-info.yml"
 Collecting vCenter information.
String PBVCGETVHOSTSTATES = "${PBDIRVMWARE}/vcenter_get-vhoststates.yml"
 Collecting / Refreshing vhost conenction states.
String PBVCVMDEPLOY = "${PBDIRVMWARE}/vcenter_deploy-vm.yml"
 Deploys a VM over a given vCenter to a ESX host.
String PBVCSHOW = "${PBDIRVMWARE}/vcenter_show-avail.yml"
 Parse and show all local defined vCenters.
String PBVMNEWDISK = "${PBDIRVMWARE}/ae_vm_add-new-disk.yml"
 Add an additional disk to an existing VM.
String PBPVEDEPLOY = "${PBDIRPROXMOX}/px_create_vm.yml"
 Deploys a VM to Proxmox.
String PBPVEGETNODES = "${PBDIRPROXMOX}/px_get_nodes.yml"
 Get configured PVE nodes.
String PBGCPGETIDS = "${PBDIRGOOGLECP}/gcp_get_ids.yml"
 Get configured GCP project ids.
String PBGCPDEPLOY = "${PBDIRGOOGLECP}/gcp_deploy_instance.yml"
 Deploy GCP instance(s).
String PBSYSDISKFORMAT = "${PBDIRSYSTEM}/disk_format.yml"
 Formats a disk.
String PBBASEINSTALL = "${PBDIRSYSTEM}/ae_system_base.yml"
 setup the default base of a deployed system
String PBSYSUPGRADE = "${PBDIRSYSTEM}/ae_system_upgrade.yml"
 System Upgrade.
String PBSSHCHK = "${PBDIRSYSTEM}/ae_ssh.yml"
 Initial SSH connect.
String PBSYSREBCHECK = "${PBDIRSYSTEM}/system_upgrade_rebootcheck.yml"
 a general system reboot check
String PBSYSREBOOT = "${PBDIRSYSTEM}/ae_system_reboot.yml"
 general system reboot (linux)
String PBCREATEUSER = "${PBDIRSYSTEM}/ae_create_useracc.yml"
 Playbook for creating a linux user.
String PBDEPLOYKEY = "${PBDIRSPLUNK}/deploy_splunk_pubpem.yml"
 Playbook for deploying a splunk pub key.
String PBLOCGETVAR = "${PBDIRLOCAL}/get_ansible_var.yml"
 Playbook for accessing a given ansible variable.
String PBFETCHFILES = "${PBDIRSPLUNK}/fetch_files.yml"
 Playbook for fetching files locally.
String DEFSPLAPIADMIN = admin
 default splunk API (target:8089) admin account
String DEFHOSTFILE = hosts
 default filename for host/group definitions in ansible
String GLABSETTINGS = "$WORKDIR/gitlab.auth"
 gitlab authentication file
String AEUSER = pors
 local username for running PORS
String ENABLEVAULT = yes
 Make use of the Ansible Vault.
String SESSIONBASEDVAULT = yes
 Store the Ansible Vault temp file for the whole session.
String DEFAULTVAULT = $AINVENTORY/$TARGETENV/group_vars/all/vault.yml
 full path to the default vault
String VALIDROLES = "activeinput deployer deploymentserver generic heavyforwarder httpeventcollector licensemaster logstream_leader logstream_worker masternode monitoringconsole peernode searchhead shcmember universalforwarder"
 Valid Splunk Server Role names.
String DEFUPGDELAY = 10s
 Guided upgrade default wait time.
String VAULTTEMPFILE = "${WORKDIR}/.avtmp"
 The temporary file holding the Ansible Vault password.
Exported String SHOSTFILE = $HOSTFILE
Exported String BTARGET = "$HOSTSELECTION"
Exported String DEPLOYAPPSUBSET = 1
Exported String CLEANHOSTFILE = yes
Exported String PARENTPID = $BASHPID
Exported String LISTTYPE = radiolist
Exported String MAXAVERSION = $(F_CHECKVERSION)
Exported String BDEPAPPSUBSET = 0
Exported String BDEPAPP = "$2"
Exported String BATCHACT = "$2"
Exported String FORCEDHOSTFILE = "$2"
Exported String STEALTHMODE = 1

Detailed Description

PORS is an UI for managing your whole Splunk infrastructure with Ansible.

Author
Thomas Fischer <mail -AT- sedi -DOT- one>
Date
2017-2026


This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Function Documentation

◆ F_ABIN()

F_ABIN ( 1 ,
2 ,
3 ,
4 ,
5  )

start ansible-playbook

Parameters
1(required) the ansible hostfile or the special "version" tag
2(required) the ansible playbook
3(required) the title for the progressbox of the playbook run
4(optional) ansible extra args. space separated parameters like -e 'var1=moo var2=cow' need to be defined in JSON format
5(optional) a YAML or json formatted filename containing extra vars

Main function for all ansible-playbook commands (previously 'F_A2BIN') example args: F_ABIN hosts myplaybook myboxtitle "-e {'var1':'moo','var2':'cow'}" if started with RUNMODE=batch it will not print dialogs at all

◆ F_ADDDEP()

F_ADDDEP ( )

Configures splunk to be a SHC Deployer.

Exceptions
..

..

◆ F_ADDDISK()

F_ADDDISK ( 1 ,
2  )

Add a new disk to a system.

Parameters
1required: source file containing the hw config
2optional: skip count (e.g. 1 means start from the 2nd disk or 2 means start from the 3rd ..)
Exceptions
TODO

Will add all disks specified in the given PORS hardware config Adding a new single disk to an existing system must ensure that param 1 is containing just the new disk

◆ F_ADDDS()

F_ADDDS ( )

Configures a new peer as SearchHead DeploymentServer.

Exceptions
..

..

◆ F_ADDHF()

F_ADDHF ( )

Configures splunk to be a Heavy Forwarder.

Exceptions
..

..

◆ F_ADDLM()

F_ADDLM ( )

Configures splunk to be a LicenseMaster.

Exceptions
..

..

◆ F_ADDMC()

F_ADDMC ( )

Configures a new peer as MonitoringConsole.

Exceptions
..

..

◆ F_ADDMN()

F_ADDMN ( )

Configures splunk to be a MasterNode.

Exceptions
..

..

◆ F_ADDPEER()

F_ADDPEER ( )

Configures a new peer to an existing indexer cluster.

Exceptions
..

Configures a new peer to an existing indexer cluster

◆ F_ADDSERVICEUSER()

F_ADDSERVICEUSER ( 1 ,
2 ,
3  )

Creates the OS_SERVICE_USER linux user account and add any extra groups needed.

Parameters
1(required) the remote hostname where the user should be created
2(required) the username to be added
3(required) the linux group name
Returns
success|fail

The user created will get a random strong password which does not get stored anywhere because pubkey authentication is the way to go.

◆ F_ADDSH()

F_ADDSH ( )

Configures splunk to be a SearchHead.

Exceptions
..

..

◆ F_ADDSHCMEMBER()

F_ADDSHCMEMBER ( )

Configures a new peer as SearchHead Cluster Member.

Exceptions
..

..

◆ F_ADDSYSUSER()

F_ADDSYSUSER ( 1 ,
2 ,
3  )

Creates a linux user account and add it to a group.

Parameters
1(required) the remote hostname where the user should be created
2(required) the username to be added
3(required) the (extra) linux group names (comma separated)
Returns
success|fail

The user created will get NO password because pubkey authentication is mandatory anyways

◆ F_APPTPLUPDATE()

F_APPTPLUPDATE ( 1 ,
2 ,
3  )

updating target dirs based on the APP template dir

Parameters
1required: app.template path
2required: custom data path (usually /opt/pors_data)
3required: app name

ensures consistent tasks for all config folders

◆ F_BACKUP_SPLUNK()

F_BACKUP_SPLUNK ( )

start a splunk backup

added: 2026-03-16

◆ F_BASEINSTALL()

F_BASEINSTALL ( 1 ,
2  )

Doing/Ensure the base is as we want it.

Parameters
1optional: specific hostname (as in hosts file)
2optional: (but requires param 1 set!) the hardware profile to be sourced

This prepares or installs basic stuff we need on every system as we are using a barebone template to deploy

◆ F_CALCCIDR()

F_CALCCIDR ( 1 )

Calculates the CIDR of a given netmask.

Parameters
1required: the netmask

◆ F_CALCNETMASK()

F_CALCNETMASK ( 1 )

Calculates the NETMASK of a given CIDR.

Parameters
1required: the CIDR

◆ F_CALCTGROUP()

F_CALCTGROUP ( 1 ,
2 ,
3  )

create a temporary target group with selected hosts

Parameters
1required: temporary filename
2optional: temporary target group-name within the hosts file
3optional: a given target group for just generating host names
Exceptions
whenparam 1 missing

calculate a temporary group based on user selected values the result is a list of hosts all added to one group which allows easy handling when running playbooks

◆ F_CHECKSSH()

F_CHECKSSH ( 1 ,
2  )

system upgrade tasks

Parameters
1required: the host from the inventory to be checked
2optional: the full path to another hostfile

tbd

◆ F_CHECKVERSION()

F_CHECKVERSION ( )

Checks for Ansible version and compares it with the required one.

Returns
exitcode depending on success (0) or not (3)
output of detected Ansible version SO DO NOT ECHO ANYTHING ELSE HERE

◆ F_CHOOSEENV()

F_CHOOSEENV ( )

show available target environments to the user and let the user select one

◆ F_CLEANCONF()

F_CLEANCONF ( )

delete empty conf files (system/local related)

◆ F_CLUSTER()

F_CLUSTER ( )

Indexer cluster menu.

Exceptions
Whenno valid answer given returning to MAIN menu

Provides a menu for several cluster tasks

◆ F_CONFLOGSTREAM()

F_CONFLOGSTREAM ( 1: )

Configures cribl logstream on ansible prepared servers.

Parameters
1type (leader | worker)
Exceptions
onabort: return 4, on failure: F_ERRLOG dialog

◆ F_CONFMENU()

F_CONFMENU ( )

Configure splunk server roles.

Exceptions
..

Provides a menu to configure several splunk server roles

◆ F_DATACHANGED()

F_DATACHANGED ( )

Check if pors_data directory contain changes.

Returns
0: no changes
1: changes exists

tbd

◆ F_DATACOMMIT()

F_DATACOMMIT ( 1 ,
2  )

Commit changes within pors_data directory.

Parameters
1required: a commit title (will be shorten to 50 chars)
2required: a commit msg (will be split every 72 chars)
Returns
exitcode for commit action (should be 0)

When triggered by a function in PORS the current changes get committed and optionally pushed to a remote git repo.

◆ F_DATAGIT()

F_DATAGIT ( )

Check pors_data directory -> git connection.

tbd

◆ F_DATAPUSH()

F_DATAPUSH ( )

Push committed pors_data changes (if enabled).

Returns
Exit code for pushing the changes

tbd

◆ F_DBROWSE()

F_DBROWSE ( )

file browser (system/local related)

◆ F_DEPLOYAPP()

F_DEPLOYAPP ( )

Deploy Apps to (a) specified target(s).

Deploy Apps to (a) specified target(s)

  1. Ask for hostfile
  2. update all apps based on template
  3. re-create deploy playbook to reflect manual changes like deleting an app
  4. Ask for target group(s) to deploy
  5. Deploy

◆ F_DEPLOYKEY()

F_DEPLOYKEY ( 1 ,
2  )

Deploy a splunk server key to one or multiple targets.

Parameters
1source hostname (as in ansible hosts file)
2destination target group
Exceptions
..

Deploys the public key into etc/auth/distServerKeys/{source}. This allows to add the remote host as a search peer.

◆ F_DEPLOYMENU()

F_DEPLOYMENU ( )

A submenu for app deployment tasks.

Returns
a submenu action

Shows several deployment tasks in an own submenu

◆ F_DEPLOYVM()

F_DEPLOYVM ( )

Deploy a new blank VM based on a template.

Exceptions
..

..

◆ F_DEPLSYSC()

F_DEPLSYSC ( )

deploy system/local configs

◆ F_DIAERR()

F_DIAERR ( )

dialog box providing errorcode

simple error dialog. Use F_ERRLOG instead if you need an option to show the log file.

◆ F_DIAERR_A()

F_DIAERR_A ( 1: ,
2:  )

display a dialog error box using automatic height/width

Parameters
1error code (required)
2task name (required)

simple error dialog. Use F_ERRLOG instead if you need an option to show the log file.

◆ F_DIALOG()

F_DIALOG ( )

main dialog form with PORS presets

◆ F_DIMPORT()

F_DIMPORT ( 1 ,
2 ,
3 ,
4  )

import by ssh from an existing host (system/local related)

Parameters
1(required): Target host system where to pull from
2(required): Target host path to fetch
3(required): Local path to pull into
4(optional): Target host become user

◆ F_DLLOGSTREAM()

F_DLLOGSTREAM ( )

Downloads a specific cribl logstream release.

Returns
success/error

Takes an URL parses the relevant parts out of it and downloads to the local repo

◆ F_DLSPLUNK()

F_DLSPLUNK ( 1 )

Downloads a specific splunk release.

Parameters
1required: set splunk type (e.g. splunkforwarder)
Returns
success/error

Takes an URL parses the relevant parts out of it and downloads splunk to the local repo

◆ F_ECHOLOG()

F_ECHOLOG ( 1 ,
2  )

Logging function which also echo's to the terminal.

Parameters
1(required) the calling parent function
2(required) the message to be logged

Useful mostly for batch / API processing in PORS

◆ F_EDITSYSC()

F_EDITSYSC ( )

manage local conf files (system/local related)

◆ F_ENAPP()

F_ENAPP ( )

links an app for a host/target in PORS

◆ F_ENDSESS()

F_ENDSESS ( )

Clear session.

PORS ensures it will not be executed more then 1 time by the EXECBIT var

◆ F_ERRLOG()

F_ERRLOG ( 1 ,
2 ,
3  )

dialog box very similar to F_DIAERR but givin an option to display a given logfile

Parameters
1required: error code number
2required: task name / description to show
3optional: full path to the log file to show (defaults to $LOG)

◆ F_EXIT()

F_EXIT ( )

regular PORS exit

clean exit including clearing the session bit

◆ F_EXITUNCLEAN()

F_EXITUNCLEAN ( 1 )

exit the program unclean but controlled

Parameters
1optional: exit code (default 0)

will not clear the session bit so only needed in rare cases (e.g. –help)

◆ F_EXPANDHOSTS()

F_EXPANDHOSTS ( 1 ,
2 ,
3  )

create an expanded list of hostnames

Parameters
1target group name
2optional: expandfile (file where the hosts will be written)
3optional: requires param2. force a clean file write (removes any prev hosts). Can be specified also as an environment variable: CLEANHOSTFILE=clean
Returns
space delimited list with the expanded list of hostnames

expands a target group to a list of hostnames/ips defined in the users host file

◆ F_FETCHGITREPOS()

F_FETCHGITREPOS ( 1: )

get all available git repos

Parameters
1required: git server type (gitlab, github)

fetches all repositories accessible by a defined token (vault)

◆ F_FORMATDISK()

F_FORMATDISK ( 1 ,
2  )

Formats a new added disk of a system.

Parameters
1required: source file containing the hw config
2optional: skip count (e.g. 1 means start from the 2nd disk or 2 means start from the 3rd ..)
Exceptions
Failwhen disk is formatted already

Will format all disks specified in the given PORS hardware config Formatting new disk(s) in an existing system must ensure that param 1 is containing just the new disk(s) or that VMDISKFS=skip is set for any existing one. WARNING: this will auto-reboot the target system once completed

◆ F_GETANSIBLEVAR()

F_GETANSIBLEVAR ( 1 ,
2  )

request the value of an ansible variable

Parameters
1required: the variable name you want to query
2optional: the full path to another hostfile

tbd

◆ F_GETAPICREDS()

F_GETAPICREDS ( )

ask for splunk_user and splunk_password vars - DEPRECATED - use VAULT instead

◆ F_GETGROUPS()

F_GETGROUPS ( )

Get all configured groups for the current environment.

..

Returns
a list of all groups found

◆ F_GETSITES()

F_GETSITES ( )

Get all configured sites from a host file.

Exceptions
..

..

◆ F_GETSTAGEDLS()

F_GETSTAGEDLS ( )

Get the current staged cribl logstream version.

Returns
version string of the current staged cribl logstream package

Parses the local global var to identify the current staged cribl logstream version

◆ F_GETSTAGEDSPL()

F_GETSTAGEDSPL ( 1 )

Get the current staged splunk version.

Parameters
1optional: set splunk type (e.g. splunkforwarder)
Returns
version string of the current staged splunk package

Parses the local global var to identify the current staged splunk version

◆ F_GOAPPS()

F_GOAPPS ( )

show current apps deployment

◆ F_GOOGLECP_DEPLOY()

F_GOOGLECP_DEPLOY ( 1 )

Deploys a VM in GCP.

Parameters
1required: source file containing the hw config
Exceptions
..

The actual doing is done here while it all starts in F_DEPLOYVM

◆ F_GUIDEDUPGRADE()

F_GUIDEDUPGRADE ( 1 ,
2  )

Guided upgrade of splunk|logstream on multiple servers at once (sequentiel and ordered).

Parameters
1required. upgrade type: splunk|logstream
2optional. hostnames to upgrade
Exceptions
onabort: return 4, internal failure: 3

Prepare your very own upgrade order

◆ F_GVARDIR()

F_GVARDIR ( )

group_vars dir check and initiate if needed

◆ F_HELP()

F_HELP ( )

Usage/Help for PORS.

◆ F_HOSTFILE()

F_HOSTFILE ( 1 )

Choose / check ansible inventory file.

Parameters
1optional: mode (auto|<empty>) mode auto: will set hostfile by $SHOSTFILE variable

ask for hosts filename (will list any hosts.* files as well) returns either the hostfile or ABORTED if the user cancels

◆ F_INSTALLLOGSTREAM()

F_INSTALLLOGSTREAM ( )

Install cribl logstream on ansible prepared servers.

Exceptions
onabort: return 4, on failure: F_ERRLOG dialog

◆ F_INSTALLSPL()

F_INSTALLSPL ( 1 )

Install splunk on ansible prepared servers.

Parameters
1optional: set install type (e.g. splunkforwarder)
Exceptions
onabort: return 4, on failure: F_ERRLOG dialog

◆ F_LISTAPPS()

F_LISTAPPS ( 1 )

Parse and show apps<->target links.

Parameters
1The target group to parse for
Returns
a list of all apps linked to the target in the format: "type:app-name"
Exceptions
ifenv cant be found

$SHOWAPPS is able to handle one or multiple targets at the same time

◆ F_LISTCRIBLREPO()

F_LISTCRIBLREPO ( )

Lists cribl packages in the local repo.

Returns
a list of cribl packages (filenames) ordered by version top-level down

Lists available cribl packages in the local repository

◆ F_LISTSPLREPO()

F_LISTSPLREPO ( 1 )

Lists splunk versions in the local repo.

Parameters
1optional: set splunk type (e.g. splunkforwarder)
Returns
a list of splunk packages (filenames) ordered by version top-level down

Lists available splunk versions in the local repository

◆ F_LOCSRC()

F_LOCSRC ( 1 )

List and choose local repository files.

Parameters
1(required) Target group
Returns
choosen local hosted files

◆ F_LOG()

F_LOG ( 1 ,
2  )

Logging function.

Parameters
1(required) the calling parent function
2(required) the message to be logged

Logging function

◆ F_LOGROTATE()

F_LOGROTATE ( )

Rotates the PORS log.

Rotates the PORS log

◆ F_LOGROTATESIZE()

F_LOGROTATESIZE ( )

Rotates the PORS log by size.

Rotates the PORS log by a given max size

◆ F_MENUADVANCED()

F_MENUADVANCED ( )

the main menu window of PORS in advanced mode

◆ F_MENUMAIN()

F_MENUMAIN ( )

the main menu window of PORS in regular mode

◆ F_MENUTESTING()

F_MENUTESTING ( )

the main menu window of PORS in testing mode

◆ F_MSG()

F_MSG ( )

Just showing a simple message box param 1: required: message to show param 2: optional: window width param 3: optional: window height.

◆ F_MSGLEN()

F_MSGLEN ( 1 )

calculate the length and height of a message

this allows to set dynamic dialog windows in its height and width

Returns
Message length and height (format: "length:height")
Parameters
1required: the full message

◆ F_NOGROUPUNIQ()

F_NOGROUPUNIQ ( 1 ,
2  )

remove all group tags from a hosts file

Removes all group stanza's, sort alphabetical and just write unique entries

Parameters
1required: source host file name
2required: target file name
Returns
0: when everything is ok
3: when param 1 is not a valid file
any-other: grep errors

◆ F_PING()

F_PING ( 1 )

Checks if a target answers to a ping.

Parameters
1: the hostname or IP to ping (required)
Returns
Exit code of the ping command (all non zero means the system cannot be reached)

◆ F_PORSACTION()

F_PORSACTION ( 1 ,
2  )

Do internal PORS actions when triggered.

Parameters
1required: title or "nogit" to skip git commit
2required: msg

Examples: writing action log, committing pors_data changes

◆ F_PROXMOX_DEPLOY()

F_PROXMOX_DEPLOY ( 1 )

Deploys a system to Proxmox VE.

Parameters
1required: source file containing the hw config
Exceptions
..

The actual doing is done here while it all starts in F_DEPLOYVM

◆ F_PULLSYSC()

F_PULLSYSC ( )

pull system/local configs for remote server (system/local related)

◆ F_RMAPP()

F_RMAPP ( )

Removes an app <--> target linkage.

Exceptions
abortby user/error on unlinking

Removes an app <--> target linkage

  1. ask for complete removal or just unlink
  2. ask for target group
  3. offer multi checkbox list of all apps for that group

◆ F_RMVAULTPW()

F_RMVAULTPW ( 1 )

removes the temporary Ansible Vault pw file

Parameters
1(optional) force/override SESSIONBASEDVAULT setting

Checks for $VAULTTEMPFILE and if that exists it gets deleted. This should be used whenever F_VAULTPW was used before.

◆ F_SELECTOR()

F_SELECTOR ( )

Menu for selecting all or specific targets.

◆ F_SELHOST()

F_SELHOST ( 1 ,
2  )

Show and choose host(s).

Parameters
1specify a target group directly (non interactive - will just output ALL(!) the host(s) of a group)
2prefilter for a given group (requires param1)

Parsing the inventory, offering all groups found, parsing groups including childs, remove dups, offer host list and let the user choose

Exceptions
onabort: return 4, on failure: error dialog

◆ F_SETREPODIR()

F_SETREPODIR ( )

Set the local repository variable in PORS.

Returns
The directory name where the local repository is defined. On error it will return nothing.

Set the local repository variable in PORS

◆ F_SHELPER()

F_SHELPER ( )

shelper UI

Tasks using the shelper utility (incl. cluster-bundle deploy etc)

◆ F_SHEXEC()

F_SHEXEC ( )

splunkhelper actions

execute splunk helper commands

◆ F_SHOWAPPS()

F_SHOWAPPS ( 1 )

Deprecated way of parsing and showing apps<->target.

Parameters
1The target group to parse for
Returns
a list of all apps linked to the target
Exceptions
ifenv cant be found

This is superseeded by F_LISTAPPS and should not be used anymore

◆ F_SHOWHOSTS()

F_SHOWHOSTS ( )

shows hostnames in an expanded target group

◆ F_SHUPGRADE()

F_SHUPGRADE ( )

install/upgrade/use shelper

◆ F_SPLACT()

F_SPLACT ( )

splunk action/task/command

will exec a (predefined) splunk action/task/command splunk_action=X (where X must be defined in common/handlers)

◆ F_SSHORNOT()

F_SSHORNOT ( )

let the user choose to either catch existing conf from another host or locally (system/local related)

◆ F_STAGELS()

F_STAGELS ( 1 )

Stage a specific cribl logstream version from the local repository.

Parameters
1OPTIONAL: logstream version:hash -> will auto-stage the given version + hash
Returns
success/error

Parses the local repository for available logstream versions, let the user choose and stage that version for the PORS upgrade function

◆ F_STAGESPL()

F_STAGESPL ( 1 ,
2  )

Stage a specific splunk version from the local repository.

Parameters
1required: set splunk type (e.g. splunkforwarder)
2optional: splunk version:hash -> will auto-stage the given version + hash
Returns
success/error

Parses the local repository for available splunk versions, let the user choose and stage that version for the PORS upgrade function

◆ F_STARTVMDEP()

F_STARTVMDEP ( 1 )

Deploy a new blank VM based on a template.

Exceptions
..
Parameters
1required: target profile vendor (e.g. vmware,proxmox,googlecp,custom,..)

The VM template used to clone. should be setup and prepared in a a way that ansible is able to connect and work with afterwards.

◆ F_SYSREBOOT()

F_SYSREBOOT ( 1 ,
2 ,
2  )

reboots a remote system

Parameters
1required: the host or a list of hosts (space separated) to be rebooted
2optional: ask for a reboot (empty) or not (when set to: "autoreboot")
2optional: requires param2: can be 0 (default, do not skip reboot checks) or 1 (skip any reboot check)

tbd

◆ F_SYSUPGRADE()

F_SYSUPGRADE ( 1 ,
2  )

system upgrade tasks

Parameters
1optional: set the host for the upgrade function
2optional: (requires param 1!) when set to "autoreboot" it will not ask for reboot after upgrading has finished

Upgrade a system by the distribution package manager

◆ F_TARGETS()

F_TARGETS ( 1 ,
2  )

identify targets/hosts of a group

Parameters
1required: dialog option (checklist/radiolist)
2optional: automatic/non interactive mode (auto selected group name|empty)
Returns
list of hosts
Exceptions
onerror or abort: abort

identify targets/hosts of a group. DEPRECATED, use F_EXPANDHOSTS with F_SHOWHOSTS instead.

  1. filter out all vars
  2. get all sections and 1 next line
  3. replace [ with newline
  4. replace ] with comma, empty lines with / and remove children tag from group name
  5. remove all newlines
  6. replace // with /
  7. replace / with newline --> steps 4-7 are required to ensure even when 2 sections are written without a space between. Example: [sec1] [sec2] host As we catch always section + 1 next line on step 2 to identify empty sections the above steps ensure we will NOT have a result of: "sec1" has host "sec2"
  8. get only these lines containing a comma and something behind (means section has a value) this is needed as a section can be empty which shouldnt be shown if!

◆ F_TPLUPDATE()

F_TPLUPDATE ( )

updating target dirs based on the template dir

ensures consistent & updated tasks for all config folders

◆ F_UPGRADE()

F_UPGRADE ( 1 ,
2  )

Upgrade splunk|logstream.

Parameters
1required. upgrade type: splunk|logstream
2optional. when set: non-interactive upgrade of all hosts specified within this param

◆ F_UPGRADEMENU()

F_UPGRADEMENU ( 1 )

A submenu for upgrade tasks.

Parameters
1Specify menu type (logstream|splunk)
Returns
a submenu action

Shows several upgrade tasks in an own submenu

◆ F_UPGRADESPLC()

F_UPGRADESPLC ( )

WIP - upgrading splunk cluster env.

WIP - upgrading splunk cluster env

◆ F_VALCONF()

F_VALCONF ( )

validate a dir if it contains conf files (system/local related)

◆ F_VAULTPW()

F_VAULTPW ( )

Ask for the Vault password if required.

Exceptions
..

Ansible Vault dialog to grab the pass and store it temporary After using this you HAVE TO ensure using F_RMVAULTPW after the pw file is not needed anymore.

◆ F_VMMENU()

F_VMMENU ( )

Menu for doing VM tasks.

Exceptions
..

Provides a menu to deploy VM's and/or configure them

◆ F_VSPHERE_DEPLOY()

F_VSPHERE_DEPLOY ( 1 ,
2  )

Deploys the vSphere VM.

Parameters
1required: the full path to the hardware profile to source
2optional: destructive mode if "destroy_deploy" or non-destructive if "refonfig_only"

The actual doing is done here while it all starts in F_DEPLOYVM

◆ F_VSPHERE_DISKADD()

F_VSPHERE_DISKADD ( 1 ,
2 ,
3  )

TODO/WIP Adds a new disk to a vSphere managed VM.

Parameters
1(exported) TMPHWPROFILE
2(exported/optional) VMDISK
3(exported) VMHOST

Adds a new disk to a vSphere managed VM

◆ F_VSPHERE_DISKSETUP()

F_VSPHERE_DISKSETUP ( 1 ,
2 ,
3 ,
4 ,
5  )

TODO/WIP Formats a partition in a VM incl. setting it up.

Parameters
1(exported) TMPHWPROFILE
2(exported/optional) VMDISK
3(exported) VMHOST
4(exported/optional) VMDISKDEV
5(exported/optional) VCENTER

Will prepare LVM, format and add to fstab a given partition Only vSphere ESX is supported.

◆ F_VSPHERE_SELDS()

F_VSPHERE_SELDS ( VCDSLIST ,
VMDISKDEV ,
VMDISKMNTP ,
VMDISKSIZEGB  )

Select a datastore of a given vCenter.

Parameters
VCENTER
VCDSLIST
VMDISKDEV
VMDISKMNTP
VMDISKSIZEGB
Returns
name of datastore

Select a datastore of a given vCenter for a specific disk

◆ F_VSPHERE_VCDEFS()

F_VSPHERE_VCDEFS ( )

Collects every PORS relevant vCenter information.

Connects to a given vCenter and stores all collected stuff in $AINVENTORY/$TARGETENV/vmware (defined in $PBVCINFO playbook)

◆ F_VSPHERE_VCGETINFO()

F_VSPHERE_VCGETINFO ( )

Collects and sets every PORS relevant vCenter information.

Connects to a given vCenter and stores all collected stuff in $AINVENTORY/$TARGETENV/tmp (defined in $PBVCINFO playbook) and let the user choose from it

◆ F_WAITBOX()

F_WAITBOX ( 1: )

display a wait box (very useful when something is done in the background)

Parameters
1a short message to display

allows a 1-line (!) message where the wait box width gets sized dynamically based on the text length

Variable Documentation

◆ ABIN

String ABIN = "$APATH/ansible-playbook"

The ansible playbook binary name.

◆ ADIR

String ADIR = "/opt/pors"

auto generate the path name of the bin

the PORS install dir. can be overwritten in ~/.pors/vars

◆ AEUSER

String AEUSER = pors

local username for running PORS

Defaults to "splunk" as it is meant for multi-user environments to keep track of actions in PORS. Do not change it here, for this define AEUSER in {HOME}/.pors/vars instead

◆ AEUSRHOSTFILE

String AEUSRHOSTFILE = ${WORKDIR}/ae_current_hostfile

the user choosen hostfile will be written into this file

can be sourced like: source $AEUSRHOSTFILE - will set HOSTFILE=

◆ AINVENTORY

String AINVENTORY = "$DATADIR/inventories"

Ansible inventories directory.

the PORS inventories dir. the place where your Ansible inventories (with their subdirs like development, production) are in. also includes app links etc. should be overwritten in ~/.pors/vars for production use.

◆ ALOG

String ALOG = "$DATADIR/audit/action.log"

The PORS action log tracks any actions taken.

PORS action log. can be overwritten in ~/.pors/vars

◆ ALOGMAXMB

String ALOGMAXMB = 10

The PORS action log max size in MB before rotating.

can be overwritten in ~/.pors/vars

◆ APATH

String APATH = "/usr/bin"

The path to the regular ansible playbook binary.

◆ BIN

String BIN = ${0##*/}

auto generate the binary name without path

◆ DATADIR

String DATADIR = "/opt/pors_data"

the PORS data directory

the PORS data dir. can be overwritten in ~/.pors/vars

◆ DEFAULTSYML

String DEFAULTSYML = ${ADIR}/roles/defaults/main.yml

full path to roles/defaults/main.yml

◆ DEFAULTVAULT

String DEFAULTVAULT = $AINVENTORY/$TARGETENV/group_vars/all/vault.yml

full path to the default vault

This is used to check the typed password so it must exists (if using ENABLEVAULT=yes)

◆ DEFHOSTFILE

String DEFHOSTFILE = hosts

default filename for host/group definitions in ansible

Defaults to "hosts" and can be changed interactively in PORS when asked. Do not change it here, for this define AEUSER in {HOME}/.pors/vars instead

◆ DEFSPLAPIADMIN

String DEFSPLAPIADMIN = admin

default splunk API (target:8089) admin account

Defaults to "admin" user and can be changed interactively in PORS when asked. Do not change it here, for this define AEUSER in {HOME}/.pors/vars instead This account needs privileges to run API calls so either the admin or an user with at least the following capabilities (not tested and so maybe incomplete):

  • rest_apps_view
  • rest_properties_get
  • rest_properties_set
  • restart_splunkd FIXME: DEPRECATED -> handled by vault now

◆ DEFUPGDELAY

String DEFUPGDELAY = 10s

Guided upgrade default wait time.

The time PORS should wait between upgrading hosts when guided upgrade has been chosen

◆ EDITBIN

String EDITBIN = /usr/bin/vim

The editor which will be used e.g. when editing system/local files.

Can be overwritten by ~/.pors/vars

◆ ENABLEVAULT

String ENABLEVAULT = yes

Make use of the Ansible Vault.

When set to "yes" PORS will ask for the Vault password on certain actions hint: to operate seamless the typed password gets stored locally but only until the cookie authentication has finished. after that the temporary file gets deleted automatically. If you are scared about storing a password even temporary do not enable this functionality.

◆ GLABSETTINGS

String GLABSETTINGS = "$WORKDIR/gitlab.auth"

gitlab authentication file

stores the gitlab token for communicationg with gitlab API Do not change it here, for this define AEUSER in {HOME}/.pors/vars instead

◆ INSTDEF

String INSTDEF = splunk_installation.yml

splunk installation conf

Used to configure several splunk installation relevant stuff like tgz/rpm/version etc

◆ INSTDEFLS

String INSTDEFLS = logstream_installation.yml

cribl logstream installation conf

◆ KICKUSER

String KICKUSER = N

Default setting for overtaken a running session.

normally we want to have 1 instance running the same time. This avoids dozens of problems which could occur. The default when pressing just enter can be y (remove and take the lock) or N (quit)

◆ LOG

Exported String LOG = ${LOGDIR}/$(date +%F_%H-%M)_${BIN}.log

The log file.

◆ LOGDIR

String LOGDIR = ${WORKDIR}/logs

The log directory.

◆ MAXLOG

String MAXLOG = 7

How many log files are allowed before rotate starts.

◆ NCURSES_NO_UTF8_ACS

Exported String NCURSES_NO_UTF8_ACS = 1

ensure PuttY will not look ugly

◆ OS_SERVICE_USER

Exported String OS_SERVICE_USER =

An (optional) service account username.

This account will be added when installing a new VM only. So on a new VM deployment this user will be created and given root permissions. The if empty check must exists to make it appear in the doc..

◆ PBBASEINSTALL

String PBBASEINSTALL = "${PBDIRSYSTEM}/ae_system_base.yml"

setup the default base of a deployed system

El-Repo kernel and system upgrades are just 2 examples here

◆ PBCONFDEP

String PBCONFDEP = ${PBDIRSPLUNK}/configure_deployer.yml

Configures splunk as a SHC deployer.

This will configure an existing splunk installation as a Deployer

◆ PBCONFDS

String PBCONFDS = ${PBDIRSPLUNK}/configure_deploymentserver.yml

Configures splunk as a deploymentserver.

This will configure an existing splunk installation as a DeploymentServer

◆ PBCONFHF

String PBCONFHF = ${PBDIRSPLUNK}/ae_configure_heavyforwarder.yml

Configures splunk as a heavy forwarder.

This will configure an existing splunk installation as a Heavy Forwarder

◆ PBCONFLM

String PBCONFLM = ${PBDIRSPLUNK}/configure_licensemaster.yml

Configures splunk as a license master.

This will configure an existing splunk installation as a LicenseMaster

◆ PBCONFLOGSTREAM

String PBCONFLOGSTREAM = ${PBDIRCRIBL}/configure_logstream.yml

Configure cribl logstream.

Will configure cribl logstream on a single host or group of hosts

◆ PBCONFMC

String PBCONFMC = ${PBDIRSPLUNK}/configure_monitoringconsole.yml

Configures splunk as a Monitoring Console.

This will configure an existing splunk installation as a MonitoringConsole

◆ PBCONFMN

String PBCONFMN = ${PBDIRSPLUNK}/ae_configure_masternode.yml

Configures splunk as a master node.

This will configure an existing splunk installation as a MasterNode for a new cluster

◆ PBCONFMONROLES

String PBCONFMONROLES = ${PBDIRSPLUNK}/configure_monitoringroles.yml

(Re-)configure the MonitoringConsole roles

◆ PBCONFPEER

String PBCONFPEER = ${PBDIRSPLUNK}/ae_configure_ix_peernode.yml

Configures splunk as a peernode.

This will configure an existing splunk installation as a peernode of an existing indexer cluster

◆ PBCONFSH

String PBCONFSH = ${PBDIRSPLUNK}/ae_configure_searchhead.yml

Configures splunk as a searchhead.

This will configure an existing splunk installation as a SearchHead

◆ PBCONFSHCM

String PBCONFSHCM = ${PBDIRSPLUNK}/configure_shcmember.yml

Configures splunk as a SHC member.

This will configure an existing splunk installation as a SHC member

◆ PBCREATEUSER

String PBCREATEUSER = "${PBDIRSYSTEM}/ae_create_useracc.yml"

Playbook for creating a linux user.

◆ PBDEPLAPP

String PBDEPLAPP = ae_deploy_apps.yml

Deploy apps to given targets.

This playbook gets autogenerated when running $PBREGENDEPLOY

◆ PBDEPLMONKEY

String PBDEPLMONKEY = ${PBDIRSPLUNK}/deploy_monitoringkeys.yml

Deploys the MonitoringConsole key for monitoring given targets.

◆ PBDEPLOYKEY

String PBDEPLOYKEY = "${PBDIRSPLUNK}/deploy_splunk_pubpem.yml"

Playbook for deploying a splunk pub key.

◆ PBDEPLSYSC

String PBDEPLSYSC = ${PBDIRSPLUNK}/ae_deploy_systemconfigs.yml

Deploy system/local configs to given targets.

◆ PBDIR

String PBDIR = "$ADIR/playbooks"

The directory where all playbooks are expected (base path).

Can be overwritten by ~/.pors/vars

◆ PBDIRCRIBL

String PBDIRCRIBL = "$PBDIR/cribl"

The directory where all CRIBL playbooks are expected.

playbooks for CRIBL logstream

◆ PBDIRGOOGLECP

String PBDIRGOOGLECP = "$PBDIR/googlecp"

The directory where all GCP playbooks are expected.

playbooks for Google Cloud Platform (GCP)

◆ PBDIRLOCAL

String PBDIRLOCAL = "$PBDIR/local"

playbooks for local (i.e. ansible) itself

The directory where all local playbooks (usually ansible related) are expected

◆ PBDIRPROXMOX

String PBDIRPROXMOX = "$PBDIR/proxmox"

The directory where all PVE playbooks are expected.

playbooks for Proxmox VE (PVE)

◆ PBDIRSHELPER

String PBDIRSHELPER = "$PBDIR/shelper"

The directory where all shelper playbooks are expected.

playbooks for splunk shelper

◆ PBDIRSPLUNK

String PBDIRSPLUNK = "$PBDIR/splunk"

The directory where all splunk playbooks are expected.

playbooks for splunk

◆ PBDIRSYSTEM

String PBDIRSYSTEM = "$PBDIR/system"

The directory where all system playbooks are expected.

playbooks for System

◆ PBDIRVMWARE

String PBDIRVMWARE = "$PBDIR/vmware"

The directory where all vmware playbooks are expected.

playbooks for VMware

◆ PBDLLOGSTREAM

String PBDLLOGSTREAM = ${PBDIRCRIBL}/ae_download_logstream.yml

Downloader for cribl logstream.

Will download a defined logstream release directly from cribl

◆ PBDLSPL

String PBDLSPL = ${PBDIRSPLUNK}/ae_download_splunk.yml

Downloader for splunk tar's.

Will download a defined splunk release (hard coded type: linux/64bit/tar.gz) directly from splunk

◆ PBENAPP

String PBENAPP = ${PBDIRSPLUNK}/ae_enable_app.yml

Adding/Linking new app(s) to PORS.

◆ PBFETCHFILES

String PBFETCHFILES = "${PBDIRSPLUNK}/fetch_files.yml"

Playbook for fetching files locally.

◆ PBGCPDEPLOY

String PBGCPDEPLOY = "${PBDIRGOOGLECP}/gcp_deploy_instance.yml"

Deploy GCP instance(s).

Deploy a Google Cloud Platform (GCP) instance (including configuration)

◆ PBGCPGETIDS

String PBGCPGETIDS = "${PBDIRGOOGLECP}/gcp_get_ids.yml"

Get configured GCP project ids.

Get configured Google Cloud Platform project ids from the ansible config

◆ PBGETGROUPS

String PBGETGROUPS = "${PBDIRLOCAL}/get_inventory_groups.yml"

Fetch all accessible ansible groups for the current environment.

Fetch all accessible ansible groups for the current environment

◆ PBGETTARGETS

String PBGETTARGETS = ${PBDIRSPLUNK}/ae_get_targets.yml

Parsing inventories file and create an expanded host list for each target.

◆ PBGHFETCHREPOS

String PBGHFETCHREPOS = "${PBDIRSPLUNK}/github_get_repos.yml"

Fetch all accessible github repos.

Will connect to the defined repo server and fetches all repository locations (http or ssh - as defined)

◆ PBGLFETCHREPOS

String PBGLFETCHREPOS = "${PBDIRSPLUNK}/gitlab_get_repos.yml"

Fetch all accessible gitlab repos.

Will connect to the defined repo server and fetches all repository locations (http or ssh - as defined)

◆ PBINSTALL

String PBINSTALL = ${PBDIRSPLUNK}/ae_install_splunk.yml

Install splunk.

Will install splunk on a single host or group of hosts

◆ PBINSTALLLOGSTREAM

String PBINSTALLLOGSTREAM = ${PBDIRCRIBL}/ae_install_logstream.yml

Install cribl logstream.

Will install cribl logstream on a single host or group of hosts

◆ PBLOCGETVAR

String PBLOCGETVAR = "${PBDIRLOCAL}/get_ansible_var.yml"

Playbook for accessing a given ansible variable.

◆ PBPVEDEPLOY

String PBPVEDEPLOY = "${PBDIRPROXMOX}/px_create_vm.yml"

Deploys a VM to Proxmox.

Will connect to a Proxmox Node and deploys a new VM to it (based on a given template)

◆ PBPVEGETNODES

String PBPVEGETNODES = "${PBDIRPROXMOX}/px_get_nodes.yml"

Get configured PVE nodes.

Get configured Proxmox Nodes from the ansible config

◆ PBREGENDEPLOY

String PBREGENDEPLOY = ${PBDIRSPLUNK}/ae_recreate_deploy.yml

Regenerate ae_deploy_apps.yml.

This playbook generates $PBDEPLAPP based on the linked apps<-->targets

◆ PBSHINSTALL

String PBSHINSTALL = ${PBDIRSHELPER}/ae_install_shelper.yml

◆ PBSHRELOAD

String PBSHRELOAD = ${PBDIRSYSTEM}/ae_shelper_reload.yml

◆ PBSPLACT

String PBSPLACT = ${PBDIRSPLUNK}/splunk_actions.yml

Maintenance tasks for splunk.

Examples: splunk stop, start, restart

◆ PBSPLBACKUP

String PBSPLBACKUP = ${PBDIRSPLUNK}/backup_splunk.yml

Initiating a splunk backup, manually and during a splunk upgrade.

◆ PBSSHCHK

String PBSSHCHK = "${PBDIRSYSTEM}/ae_ssh.yml"

Initial SSH connect.

Will add the host key when none exists yet. Add will be skipped when a host key changed!

◆ PBSYSDISKFORMAT

String PBSYSDISKFORMAT = "${PBDIRSYSTEM}/disk_format.yml"

Formats a disk.

Formats an existing (!) disk

◆ PBSYSREBCHECK

String PBSYSREBCHECK = "${PBDIRSYSTEM}/system_upgrade_rebootcheck.yml"

a general system reboot check

checks with several methods if a system reboot is required

◆ PBSYSREBOOT

String PBSYSREBOOT = "${PBDIRSYSTEM}/ae_system_reboot.yml"

general system reboot (linux)

reboots a remote system

◆ PBSYSUPGRADE

String PBSYSUPGRADE = "${PBDIRSYSTEM}/ae_system_upgrade.yml"

System Upgrade.

Refreshes cache DB and starting a full system upgrade

◆ PBUPGRADE

String PBUPGRADE = ${PBDIRSPLUNK}/ae_upgrade_splunk.yml

Upgrade splunk.

◆ PBUPGRADELOGSTREAM

String PBUPGRADELOGSTREAM = ${PBDIRCRIBL}/ae_upgrade_logstream.yml

Upgrade cribl logstream.

Will upgrade cribl logstream on a single host or group of hosts

◆ PBVCGETVHOSTSTATES

String PBVCGETVHOSTSTATES = "${PBDIRVMWARE}/vcenter_get-vhoststates.yml"

Collecting / Refreshing vhost conenction states.

Will connect to a vCenter and re-evaluates the states for each connected vhost (ESX)

◆ PBVCINFO

String PBVCINFO = "${PBDIRVMWARE}/vcenter_get-info.yml"

Collecting vCenter information.

Will connect to a vCenter and grabs all relevant information for VM deployment

◆ PBVCSHOW

String PBVCSHOW = "${PBDIRVMWARE}/vcenter_show-avail.yml"

Parse and show all local defined vCenters.

vCenter definitions are taken in: $INVENTORY/$TARGETENV/group_vars/all/bare_install The playbook $PBVCSHOW will parse and write the results to a tmp file defined in $PBVCSHOW

◆ PBVCVMDEPLOY

String PBVCVMDEPLOY = "${PBDIRVMWARE}/vcenter_deploy-vm.yml"

Deploys a VM over a given vCenter to a ESX host.

Will connect to a vCenter and deploys a new VM to it (based on a given template)

◆ PBVMNEWDISK

String PBVMNEWDISK = "${PBDIRVMWARE}/ae_vm_add-new-disk.yml"

Add an additional disk to an existing VM.

..

◆ PLAYNOISE

Exported String PLAYNOISE = "-vv"

Verbosity level of playbooks.

By default only basic output will be shown which can be increased by starting PORS with –verbose (equals to -vvv) or –debug (equals to -vvvv) Do not change this value here. If you want to override the default setting here adjust the ~/.pors/vars file instead

◆ PYTHONUNBUFFERED

Exported String PYTHONUNBUFFERED = 1

avoid buffering when exec python code (ansible)

when python buffers output PORS seems to hang until the whole playbook has been finished without any feedback. This ensures we see output directly in PORS.

◆ REQAVERSION

String REQAVERSION = "2.8.0"

The minimal required Ansible version.

the version string in the format: X.x.x

◆ ROLEDIR

String ROLEDIR = "$ADIR/roles"

The directory where all roles are expected.

Can be overwritten by ~/.pors/vars

◆ RUNMODE

Exported String RUNMODE = "interactive"

PORS can run in several modes this sets the default.

There is no (!) need to touch this as it will be adjusted depending on the parameters how PORS is started (e.g. –batch will set batch mode)

◆ SESSIONBASEDVAULT

String SESSIONBASEDVAULT = yes

Store the Ansible Vault temp file for the whole session.

When set to "yes" PORS will not remove the temporary Vault password (req: ENABLEVAULT=yes) for the whole session (less questions but less secure). When PORS ends it will be deleted of course. If you are scared about storing a password even temporary do not enable this functionality.

◆ SHOWAPPS

String SHOWAPPS = ${ADIR}/ae_show_app_deploymentstate.sh

Show app deployment state by target(s) and type (local, git, ...).

◆ VALIDROLES

String VALIDROLES = "activeinput deployer deploymentserver generic heavyforwarder httpeventcollector licensemaster logstream_leader logstream_worker masternode monitoringconsole peernode searchhead shcmember universalforwarder"

Valid Splunk Server Role names.

these are in use everwhere in PORS, i.e. in playbooks, target groups as well. Fully static. do NOT touch these.

◆ VAULTTEMPFILE

String VAULTTEMPFILE = "${WORKDIR}/.avtmp"

The temporary file holding the Ansible Vault password.

Only relevant if ENABLEVAULT is set to yes. to operate seamless the typed password gets stored locally but only until the cookie authentication has finished. after that the temporary file gets deleted automatically. If you are scared about storing a password even temporary do not set ENABLEVAULT=yes . The temporary file is placed in WORKDIR which is accessible by the PORS user only!

◆ VBIN

String VBIN = "/usr/bin/ansible-vault"

The full path to the regular ansible-vault binary.

◆ WORKDIR

String WORKDIR = "$MYHOME"

The working directory where all run files will be stored.

Every user has its own temp directory accessible only by the PORS user