This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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';\"" |
NewerOlder