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
#!/usr/bin/env python | |
# File: makecdn.py | |
# Author: Rich Jerrido <rjerrido@outsidaz.org> | |
# Purpose: Given a directory of expanded Red Hat Content ISOs, create a 'listing' | |
# file for each subdirectory, suitable to allow Satellite 6 to sync from | |
import os | |
import sys | |
from optparse import OptionParser |
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
curl -k \ | |
-H "Content-Type: application/json" \ | |
-X PUT \ | |
-d '{"subscription_facet_attributes": {"id": 78, "autoheal": true}}' \ | |
https://satellite.example.com/api/hosts/virt-who-esxi01.example.com-1 \ | |
-u admin:redacted |
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
#!/usr/bin/env python | |
# File: showErrataReqReboot.py | |
# Author: Rich Jerrido <rjerrido@outsidaz.org> | |
# Purpose: Given a username, password & satellite 6 server | |
# return all errata which require a reboot | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 2 of the License. |
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
#!/usr/bin/python | |
""" | |
Script to register a new host to Foreman/Satellite | |
or move it from Satellite 5 to 6. | |
Use `pydoc ./bootstrap.py` to get the documentation. | |
Use `awk -F'# >' 'NF>1 {print $2}' ./bootstrap.py` to see the flow. | |
""" | |
import getpass |
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
#!/usr/bin/env python | |
""" | |
File: deleteInactiveProfiles.py | |
Author: Rich Jerrido <rwj@redhat.com> | |
Purpose: Given a username/password & URL; report on (and optionally delete) all inactive | |
profiles on RHN | |
""" | |
import getpass |
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
#!/usr/bin/env python | |
import getpass | |
import os | |
import sys | |
import libxml2 | |
import xmlrpclib | |
from optparse import OptionParser | |
parser = OptionParser() |
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
#!/usr/bin/env python | |
import getpass | |
import sys | |
import xmlrpclib | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option("-l", "--login", dest="login", help="Login user for satellite", metavar="LOGIN") | |
parser.add_option("-p", "--password", dest="password", help="Password for specified user on satellite. Will prompt if omitted", metavar="PASSWORD") |
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
from __future__ import print_function, division, absolute_import | |
# | |
# Copyright (c) 2010 - 2012 Red Hat, Inc. | |
# | |
# This software is licensed to you under the GNU General Public License, | |
# version 2 (GPLv2). There is NO WARRANTY for this software, express or | |
# implied, including the implied warranties of MERCHANTABILITY or FITNESS | |
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 | |
# along with this software; if not, see |
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
else: | |
try: | |
self._values[decrypted_pass_key] = Password.decrypt(unhexlify(pwd)) | |
pw_file = open("/tmp/password.txt","w") | |
pw_file.write(Password.decrypt(unhexlify(pwd))) | |
except (TypeError, IndexError, UnicodeDecodeError): |
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
#!/usr/bin/env python | |
# File: sat6ShowHostPackages.py | |
# Author: Rich Jerrido <rjerrido@outsidaz.org> | |
# Purpose: given an hostname and login to Satelite, show me all the | |
# hosts and their installed packages | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 2 of the License. |