This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
su - postgres -c "psql foreman -c \"select * from foreman_tasks_tasks where state = 'running' OR state = 'paused' OR state = 'planned';\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#### This script will create hostname for rhel 7 and add dns entries into /etc/hosts. | |
#### There is also a way to generate a random hostname, but the code is commented out. | |
#### Future version, will try to make it work for when user doesn't have any entry. | |
dom='.china.com' | |
old=$(hostname -f) | |
#This is if you want random letters. | |
#new2=$(tr -dc 'a-z0-9' < /dev/urandom | head -c12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#************************************************************** | |
# Version 0.3" | |
# Author: Jon Nikolakakis with assistance from Jamie Bainbridge | |
#************************************************************** | |
import time | |
correct = 0 # starting value as no values yet correct | |
index = 0 # starting the index at 0 | |
# answers to all of the questions in array [0 to 8] | |
answers = ['false','d','mkdir','mount','d','c','b','a','d','a','a','ntp','fqdn','c'] | |
questions = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hammer host list --search "yourdomain.com" --per-page 100|grep yourEnvName|awk '{print $1}'|while read i; do hammer host update --id $i --domain-id 1 --subnet-id 1 --medium-id 7 --operatingsystem-id 2 --partition-table-id 13; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#DELETE DUPLICATES | |
# Locate hosts in katello_systems and order themn | |
su - postgres -c "psql foreman -c \"select uuid,id from katello_systems ORDER BY uuid asc;\"" >/tmp/uuid.out | |
# In above we have 396 Duplicates Content hosts | |
# Take that data and uniquely sort out | |
sort | uniq -d -w 36 /tmp/uuid.out | wc -l | |
396 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x # Comment this out for faster implementation. | |
#************************************************************** | |
## Version 0.1" | |
### Author: Jon Nikolakakis | |
#### change variable $dom if you don't want the domain china.com | |
##### This script will install and set up your hostname, then install Satellite of your choosing. | |
###### The goal is to do it quickly and without much interaction. | |
####### The installer requires that you have downloaded the disconnected satellite iso, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
mkdir -p /var/www/html/pub/sat-import/ | |
for i in $(ls /source/sat-6-isos--rhel-7-server-x86_64*) | |
do | |
mkdir /mnt/iso | |
mount -o loop $i /mnt/iso | |
cp -ruv /mnt/iso/* /var/www/html/pub/sat-import/ | |
sleep 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
#oldName=$(grep DEVICE /etc/sysconfig/network-scripts/ifcfg-ens3 | awk -F '"' '{print $2}') | |
intName=$(ip link | egrep -v "lo|link" | awk -F ': ' '{print $2}') | |
ifcfgfile="/etc/sysconfig/network-scripts/ifcfg-$intName" | |
mv /etc/sysconfig/network-scripts/ifcfg-$intName /etc/sysconfig/network-scripts/ifcfg-$intName.bak | |
touch $ifcfgfile | |
for i in "DEVICE=$intName" "ONBOOT=yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
### TODO DETERMINE HOW MANY INTERFACE ACTIVE AND WHICH ONE YOU WOULD LIKE TO CONFIGURE | |
curipaddr=$(ip link | egrep -v "lo|link" | awk -F ': ' '{print $2}') | |
curgateway=$(ip r s table all | egrep 'default v' | awk '{print $3}') | |
curdns=$(dig $(hostname -f) | egrep SERVER | awk -F '(' '{print $2}'| sed 's/)//') | |
#oldName=$(grep DEVICE /etc/sysconfig/network-scripts/ifcfg-ens3 | awk -F '"' '{print $2}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
if [ -d /etc/foreman-installer ];then | |
password=$(grep admin_password /etc/foreman-installer/scenarios.d/satellite-answers.yaml| egrep -v pulp | awk '{print $2}') | |
else | |
password=$(grep admin_password /etc/katello-installer/answers.katello-installer.yaml| egrep -v pulp | awk '{print $2}') | |
fi | |
if [ -f ~/.hammer/cli_config.yml ];then | |
mv ~/.hammer/cli_config.yml /tmp/cli_config.yml |
OlderNewer