Sync last changes

This commit is contained in:
2025-07-09 14:31:11 -04:00
parent cf3811c98f
commit 1378d8a38e
23 changed files with 4051 additions and 8 deletions

103
notes/ldap_auth_notes.txt Normal file
View File

@ -0,0 +1,103 @@
=================================
LDAP SERVER URI
=================================
ldap://10.10.42.250
=================================
LDAP BIND DN
=================================
CN=ansbl_ldap_svc,CN=Users,DC=thezengarden,DC=net
=================================
LDAP GROUP TYPE
=================================
ActiveDirectoryGroupType
=================================
LDAP USER SEARCH
=================================
[
"OU=tower_dev,DC=thezengarden,DC=net",
"SCOPE_SUBTREE",
"(sAMAccountName=%(user)s)"
]
=================================
LDAP GROUP SEARCH
=================================
[
"OU=tower_dev,DC=thezengarden,DC=net",
"SCOPE_SUBTREE",
"(objectClass=group)"
]
=================================
LDAP USER ATTRIBUTE MAP
=================================
{
"first_name": "givenName",
"last_name": "sn",
"email": "mail"
}
=================================
LDAP USER FLAGS BY GROUP
=================================
{
"is_superuser": [
"CN=tower_dev_admins,OU=tower_dev,DC=thezengarden,DC=net"
],
"is_system_auditor": [
"CN=tower_dev_auditors,OU=tower_dev,DC=thezengarden,DC=net"
]
}
=================================
LDAP ORGANIZATION MAP
=================================
{
"LDAP Lab": {
"users": [
"CN=tower_dev_auditors,OU=tower_dev,DC=thezengarden,DC=net",
"CN=tower_dev_users,OU=tower_dev,DC=thezengarden,DC=net"
],
"remove_admins": true,
"admins": "CN=tower_dev_admins,OU=tower_dev,DC=thezengarden,DC=net"
},
"CSV Inventory Demo": {
"users": [
"CN=tower_dev_demo,OU=tower_dev,DC=thezengarden,DC=net"
],
"remove_admins": true,
"admins": "CN=tower_dev_demo,OU=tower_dev,DC=thezengarden,DC=net"
}
}
=================================
LDAP TEAM MAP
=================================
{
"LDAP Lab Admins": {
"users": "CN=tower_dev_admins,OU=tower_dev,DC=thezengarden,DC=net",
"organization": "LDAP Lab",
"remove": true
},
"LDAP Lab Auditors": {
"users": "CN=tower_dev_auditors,OU=tower_dev,DC=thezengarden,DC=net",
"organization": "LDAP Lab",
"remove": true
},
"LDAP Lab Users": {
"users": "CN=tower_dev_users,OU=tower_dev,DC=thezengarden,DC=net",
"organization": "LDAP Lab",
"remove": true
}
}

18
utils/add_host.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
RUN_DATE=`date`
BASE_URL="tower2.thezengarden.net"
AAP_INVENTORY=8
POST_PAYLOAD_PATH="post.add_host"
POST_PAYLOAD_TYPE="application/json"
TOWER_TOKEN="jQwHURhs9fNNyombPLEAK8a2vRmmBQ"
curl -k -H "Authorization: Bearer ${TOWER_TOKEN}" \
-H "Content-type: ${POST_PAYLOAD_TYPE}" \
-X POST \
-d @"${POST_PAYLOAD_PATH}" \
"https://${BASE_URL}/api/v2/inventories/${AAP_INVENTORY}/hosts/"

18
utils/add_inv.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
RUN_DATE=`date`
BASE_URL="tower2.thezengarden.net"
AAP_INVENTORY="LabTest ${RUN_DATE}"
POST_PAYLOAD_PATH="post.add_inv"
POST_PAYLOAD_TYPE="application/json"
#TOWER_TOKEN="jQwHURhs9fNNyombPLEAK8a2vRmmBQ"
TOWER_TOKEN="YtLStVtkMGKxnWinslNiqDgYwZqKfM"
curl -s -k -H "Authorization: Bearer ${TOWER_TOKEN}" \
-H "Content-type: ${POST_PAYLOAD_TYPE}" \
-X POST \
-d @"${POST_PAYLOAD_PATH}" \
"https://${BASE_URL}/api/v2/inventories/"
echo

18
utils/db.txt Normal file
View File

@ -0,0 +1,18 @@
/var/opt/rh/rh-postgresql10/lib/pgsql/data/postgresql.conf
----------------------------------------------------------
log_autovacuum_min_duration = '0'
log_checkpoints = 'True'
log_connections = 'True'
log_disconnections = 'True'
log_line_prefix = '%m [%r] [%p]: [l-%l] user=%u,db=%d,app=%a,e=%e, prcstm=%s '
log_lock_waits = 'True'
log_min_duration_statement = 900
max_connections = 512
shared_buffers = 4800MB
work_mem = 8MB
maintenance_work_mem = 600MB
effective_cache_size = 12000MB
select * from pg_settings where name like 'autovacuum%';

30
utils/dns_parse.pl Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/perl
use strict;
my $BASE_URL="tower2.thezengarden.net";
my $AAP_INVENTORY=14;
my $CONTENT_TYPE="Content-type: application/json";
my $TOWER_TOKEN="Authorization: Bearer YtLStVtkMGKxnWinslNiqDgYwZqKfM";
my $csv = $ARGV[0];
open (CSV, "< $csv") or die "unable to read $csv: $0\n";
while (my $line = <CSV>)
{
chomp $line;
$line =~ s/\r//g;
my @host = split(/,/, $line);
next if $host[1] =~ /Not/;
my $json_args = "{\"name\": \"$host[1]\", \"description\": \"$host[0]\"}";
print "$json_args\n";
my $add_host_post = `curl -s -k -H \"$TOWER_TOKEN\" -H \"$CONTENT_TYPE\" -X POST -d '$json_args' \"https://$BASE_URL/api/v2/inventories/$AAP_INVENTORY/hosts/\"`;
print "$add_host_post\n";
}

5
utils/hi Normal file
View File

@ -0,0 +1,5 @@
cat logfile.txt | grep "bytes in" | awk '{print "time: "$13, $14, $15, $16,"request_type: "$17, "endpoint: "$18, "output_bytes: "$21, "response_time: "$24" ms"}' | sed 's/\]/ /g'
cat 2k_awx-uwsgi.log | grep "bytes in" | awk '{print "time: "$13, $14, $15, $16,"request_type: "$17, "endpoint: "$18, "output_bytes: "$21, "response_time: "$24" ms"}' | sed 's/\]/ /g'

23
utils/limit_test.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
CONC="1"
REQU="1"
BASE_URL="tower2.thezengarden.net"
AAP_JOB_ID="63"
POST_PAYLOAD_PATH="provision.limit-dev"
POST_PAYLOAD_TYPE="application/json"
TOWER_USER="admin"
TOWER_PASS="redhat"
printf "\n%s\n" \
"# Running test ${ITER}"
ab -c "${CONC}" \
-n ${REQU} \
-A ${TOWER_USER}:${TOWER_PASS} \
-T "${POST_PAYLOAD_TYPE}" \
-v1 \
-p ${POST_PAYLOAD_PATH} "https://${BASE_URL}/api/v2/job_templates/${AAP_JOB_ID}/launch/" | \
grep "Failed requests\|Time taken for tests"

24
utils/metrics_load_test.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
CONC="10"
REQU="10"
#BASE_URL="tower2.thezengarden.net"
BASE_URL="10.10.42.225"
AAP_JOB_ID="57"
POST_PAYLOAD_TYPE="application/json"
TOWER_USER="admin"
TOWER_PASS="redhat"
printf "\n%s\n" \
"# Running test - ${REQU} requests / ${CONC} concurrency"
ab -c "${CONC}" \
-n ${REQU} \
-A ${TOWER_USER}:${TOWER_PASS} \
-T "${POST_PAYLOAD_TYPE}" \
-v1 \
"https://${BASE_URL}/api/v2/metrics/" | \
grep "Failed requests\|Time taken for tests"

1
utils/post.add_host Normal file
View File

@ -0,0 +1 @@
{"name": "sample-host-1", "description": "added via add_host.sh"}

1
utils/post.add_inv Normal file
View File

@ -0,0 +1 @@
{"name": "isaac inventory", "organization": 1}

View File

@ -0,0 +1,5 @@
{"extra_vars": {"tower_provision_host": "lab-test-1,lab-test-2,lab-test-3"},"limit": "lab-dev-1,lab-dev-4"}

View File

@ -1,10 +1,11 @@
#!/bin/bash
CONC="1"
REQU="1"
CONC="100"
REQU="100"
BASE_URL="tower2.thezengarden.net"
AAP_JOB_ID="57"
#POST_PAYLOAD_PATH="empty.post"
#POST_PAYLOAD_PATH="provision.lab-dev-1"
#POST_PAYLOAD_PATH="provision.dev"
#POST_PAYLOAD_PATH="provision.test"
@ -25,3 +26,4 @@ printf "\n%s\n" \
-v1 \
-p ${POST_PAYLOAD_PATH} "https://${BASE_URL}/api/v2/job_templates/${AAP_JOB_ID}/launch/" | \
grep "Failed requests\|Time taken for tests"

3
utils/psql_lock_mon.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
for i in $(seq 3600); do date;psql awx -c 'select relation::regclass, * from pg_locks where not granted';sleep 1; done

27
utils/sample_inv.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
HOSTS=${1:-1}
RUN_DATE=`date`
BASE_URL="tower2.thezengarden.net"
#AAP_INVENTORY=9
AAP_INVENTORY=27
POST_PAYLOAD_PATH="post.add_host"
POST_PAYLOAD_TYPE="application/json"
#TOWER_TOKEN="jQwHURhs9fNNyombPLEAK8a2vRmmBQ"
TOWER_TOKEN="YtLStVtkMGKxnWinslNiqDgYwZqKfM"
for i in $(seq $HOSTS)
do
time curl -s -k -H "Authorization: Bearer ${TOWER_TOKEN}" \
-H "Content-type: ${POST_PAYLOAD_TYPE}" \
-X POST \
-d "{\"name\": \"sample-host-${i}\", \"description\": \"added via sample_inv.sh\"}" \
"https://${BASE_URL}/api/v2/inventories/${AAP_INVENTORY}/hosts/" | jq '{created_time:.["created"], hostname:.["name"], inventory:.["summary_fields"]["inventory"]["name"]}'
echo
done

41
utils/sample_inv_concurrent.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
trap "exit" INT TERM ERR
trap "kill 0" EXIT
HOSTS=${1:-50000}
SLEEP_TIME="0.05"
RUN_DATE=`date`
#$BASE_URL="tower2.thezengarden.net"
BASE_URL="10.10.42.225"
AAP_INVENTORY=42
POST_PAYLOAD_PATH="post.add_host"
POST_PAYLOAD_TYPE="application/json"
#TOWER_TOKEN="jQwHURhs9fNNyombPLEAK8a2vRmmBQ"
TOWER_TOKEN="YtLStVtkMGKxnWinslNiqDgYwZqKfM"
echo "Script start time: $(date '+%F %T %Z')"
for i in $(seq $HOSTS)
do
DESC_DATE=`date "+%F %T %Z"`
/usr/bin/time -f "%e" curl -s -k -H "Authorization: Bearer ${TOWER_TOKEN}" \
-H "Content-type: ${POST_PAYLOAD_TYPE}" \
-X POST \
-d "{\"name\": \"new-sample-host-${i}\", \"description\": \"added ${DESC_DATE}\"}" \
"https://${BASE_URL}/api/v2/inventories/${AAP_INVENTORY}/hosts/" | jq '{created_time:.["created"], hostname:.["name"], inventory:.["summary_fields"]["inventory"]["name"]}' &
sleep ${SLEEP_TIME}
echo
done
wait
echo "Script end time: $(date '+%F %T %Z')"

3647
utils/soiuedfhsdf Normal file

File diff suppressed because it is too large Load Diff

1
utils/stats.txt Normal file
View File

@ -0,0 +1 @@
python /var/lib/awx/venv/awx/bin/uwsgitop /var/lib/awx/uwsgi.stats

23
utils/stress_test.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
CONC="100"
REQU="10000"
BASE_URL="10.1.1.71"
AAP_JOB_ID="7"
POST_PAYLOAD_PATH="empty.post"
POST_PAYLOAD_TYPE="application/json"
TOWER_USER="admin"
TOWER_PASS="redhat"
printf "\n%s\n" \
"# Running test ${ITER}"
ab -c "${CONC}" \
-n ${REQU} \
-A ${TOWER_USER}:${TOWER_PASS} \
-T "${POST_PAYLOAD_TYPE}" \
-v1 \
-p ${POST_PAYLOAD_PATH} "https://${BASE_URL}/api/v2/job_templates/${AAP_JOB_ID}/launch/" | \
grep "Failed requests\|Time taken for tests"

23
utils/stress_test2.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
CONC="10"
REQU="100000"
BASE_URL="10.10.42.210"
AAP_JOB_ID="10"
POST_PAYLOAD_PATH="empty.post"
POST_PAYLOAD_TYPE="application/json"
TOWER_USER="admin"
TOWER_PASS="redhat"
printf "\n%s\n" \
"# Running test ${ITER}"
ab -c "${CONC}" \
-n ${REQU} \
-A ${TOWER_USER}:${TOWER_PASS} \
-T "${POST_PAYLOAD_TYPE}" \
-v1 \
-p ${POST_PAYLOAD_PATH} "https://${BASE_URL}/api/v2/job_templates/${AAP_JOB_ID}/launch/" | \
grep "Failed requests\|Time taken for tests"

View File

@ -1 +0,0 @@

View File

@ -1,14 +1,15 @@
#!/bin/bash
CONC="10"
REQU="10"
CONC="1"
REQU="1"
BASE_URL="tower2.thezengarden.net"
AAP_JOB_ID="54"
#BASE_URL="tower2.thezengarden.net"
BASE_URL="10.10.42.225"
AAP_JOB_ID="7"
POST_PAYLOAD_PATH="empty.post"
POST_PAYLOAD_TYPE="application/json"
TOWER_USER="jadmin"
TOWER_USER="admin"
TOWER_PASS="redhat"

23
utils/tower_test_workflow.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
CONC="1"
REQU="1"
BASE_URL="tower2.thezengarden.net"
AAP_JOB_ID="54"
POST_PAYLOAD_PATH="empty.post"
POST_PAYLOAD_TYPE="application/json"
TOWER_USER="jadmin"
TOWER_PASS="redhat"
printf "\n%s\n" \
"# Running test ${ITER}"
ab -c "${CONC}" \
-n ${REQU} \
-A ${TOWER_USER}:${TOWER_PASS} \
-T "${POST_PAYLOAD_TYPE}" \
-v1 \
-p ${POST_PAYLOAD_PATH} "https://${BASE_URL}/api/v2/workflow_job_templates/${AAP_JOB_ID}/launch/" | \
grep "Failed requests\|Time taken for tests"

7
utils/vacuum.txt Normal file
View File

@ -0,0 +1,7 @@
2023-02-24 17:55:36.937 UTC [] [23254]: [l-1] user=,db=,app=,e=00000, prcstm=2023-02-24 17:55:36 UTC LOG: automatic vacuum of table "awx.public.main_job": index scans: 1
2023-02-24 17:55:37.289 UTC [] [23254]: [l-4] user=,db=,app=,e=00000, prcstm=2023-02-24 17:55:36 UTC LOG: automatic vacuum of table "awx.public.main_host": index scans: 1
2023-02-24 17:55:37.449 UTC [] [23254]: [l-6] user=,db=,app=,e=00000, prcstm=2023-02-24 17:55:36 UTC LOG: automatic vacuum of table "awx.public.main_unifiedjob": index scans: 1
2023-02-24 17:55:37.573 UTC [] [23254]: [l-9] user=,db=,app=,e=00000, prcstm=2023-02-24 17:55:36 UTC LOG: automatic vacuum of table "awx.public.main_unifiedjobtemplate": index scans: 1
2023-02-24 17:55:37.634 UTC [] [23254]: [l-11] user=,db=,app=,e=00000, prcstm=2023-02-24 17:55:36 UTC LOG: automatic vacuum of table "awx.public.main_towerschedulestate": index scans: 0
2023-02-24 17:55:37.724 UTC [] [23254]: [l-13] user=,db=,app=,e=00000, prcstm=2023-02-24 17:55:36 UTC LOG: automatic vacuum of table "awx.pg_toast.pg_toast_2619": index scans: 1