Assuming you have a RHEL box:
# Subscribe box to get content
# -*- coding: utf-8 -*- | |
import sys | |
from robottelo.common.helpers import generate_string | |
try: | |
from singledispatch import singledispatch | |
except ImportError: | |
print "Please install the singledispatcher module" |
In [1]: from selenium import webdriver | |
In [2]: service_args = ['--ignore-ssl-errors=true'] | |
In [3]: driver = webdriver.PhantomJS(service_args=service_args) | |
In [4]: driver.get("https://aaa.bbb.ccc") | |
In [5]: driver.title | |
Out[5]: u'Login' |
import errno | |
import os | |
import socket | |
import sys | |
import time | |
from boto import ec2 | |
# ----------------------------------------------------------------------------- | |
# AMI definitions |
puppet module install -i /tmp domcleal/katellovirt | |
puppet apply -v -e 'include katellovirt' --modulepath /tmp | |
export FORWARDERS=$(for i in $(cat /etc/resolv.conf |grep nameserver|awk '{print $2}'); do echo --capsule-dns-forwarders $i;done) | |
export OAUTH_SECRET=$(grep oauth_consumer_secret /etc/foreman/settings.yaml | cut -d ' ' -f 2) | |
echo FORWARDERS: $FORWARDERS | |
echo OAUTH_SECRET: $OAUTH_SECRET | |
katello-installer --capsule-parent-fqdn $(hostname) --capsule-dns true $FORWARDERS --capsule-dns-interface virbr1 --capsule-dns-zone katellolabs.org --capsule-dhcp true --capsule-dhcp-interface virbr1 --capsule-tftp true --capsule-tftp-servername $(hostname) --capsule-puppet true --capsule-puppetca true --capsule-register-in-foreman true --capsule-foreman-oauth-secret $OAUTH_SECRET --capsule-pulp true --capsule-pulp-oauth-secret $OAUTH_SECRET |
from collections import defaultdict | |
from functools import partial | |
import sys | |
try: | |
from github import Github | |
except ImportError: | |
print "Install PyGithub: sudo pip install PyGithub" | |
sys.exit(-1) |
subscription-manager register --force --username=$USERNAME --password=$PASSWORD --autosubscribe | |
yum repolist | |
yum-config-manager --disable rhui* | |
yum-config-manager --disable rhel-ha* | |
yum-config-manager --disable rhel-rs* | |
yum-config-manager --disable rhel-lb* | |
yum-config-manager --disable rhel-6-server-cf-tools-1-rpms | |
yum-config-manager --disable *ose* | |
yum-config-manager --disable *realtime* | |
yum-config-manager --disable *rhs* |
Sauce Connect is a secure tunneling app which allows you to execute tests securely when testing behind firewalls via a secure connection between Sauce Labs’ client cloud and your environment.
Download the version of Sauce Connect that corresponds to your guest's platform. For some reason Sauce Connect v4 never worked for me, so I use Sauce Connect v3 instead.
After unpacking Sauce Connect, cd to its directory and start it up using your SauceLabs credentials:
def render(engine_id, template, **kwargs): | |
engines = { | |
"jinja2": "jinja2", | |
"mako": "make.template", | |
} | |
try: | |
module = engines[engine_id] | |
engine = __import__( | |
module, globals(), locals(), ['Template'], -1) | |
except (KeyError, ImportError) as err: |
# Block non-proxy traffic from your katello server | |
# The following environment variables must be set: | |
# SQUID: the FQDN for your proxy | |
# PROXY_USERNAME: username for squid | |
# PROXY_PASSWORD: password for your squid username | |
export ETH=$(ping -c 1 $(hostname) | grep 'icmp_seq' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}') | |
export PROXY=$(ping -c 1 $SQUID | grep 'icmp_seq' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}') |