summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README_vagrant.md4
-rw-r--r--Vagrantfile21
-rwxr-xr-xgit/pylint.sh2
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py21
-rw-r--r--roles/openshift_facts/tasks/main.yml3
-rw-r--r--roles/rhel_subscribe/tasks/main.yml11
6 files changed, 33 insertions, 29 deletions
diff --git a/README_vagrant.md b/README_vagrant.md
index f3e4cfc18..73fd31476 100644
--- a/README_vagrant.md
+++ b/README_vagrant.md
@@ -3,7 +3,6 @@ Requirements
- ansible (the latest 1.9 release is preferred, but any version greater than 1.9.1 should be sufficient).
- vagrant (tested against version 1.7.2)
- vagrant-hostmanager plugin (tested against version 1.5.0)
-- vagrant-registration plugin (only required for enterprise deployment type)
- vagrant-libvirt (tested against version 0.0.26)
- Only required if using libvirt instead of virtualbox
@@ -44,7 +43,8 @@ The following environment variables can be overriden:
- ``OPENSHIFT_DEPLOYMENT_TYPE`` (defaults to origin, choices: origin, enterprise, online)
- ``OPENSHIFT_NUM_NODES`` (the number of nodes to create, defaults to 2)
-For ``enterprise`` deployment types these env variables should also be specified:
+Note that if ``OPENSHIFT_DEPLOYMENT_TYPE`` is ``enterprise`` you should also specify environment variables related to ``subscription-manager`` which are used by the ``rhel_subscribe`` role:
+
- ``rhel_subscription_user``: rhsm user
- ``rhel_subscription_pass``: rhsm password
- (optional) ``rhel_subscription_pool``: poolID to attach a specific subscription besides what auto-attach detects
diff --git a/Vagrantfile b/Vagrantfile
index 33532cd63..362e1ff48 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -16,27 +16,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.hostmanager.include_offline = true
config.ssh.insert_key = false
- if deployment_type === 'enterprise'
- unless Vagrant.has_plugin?('vagrant-registration')
- raise 'vagrant-registration-plugin is required for enterprise deployment'
- end
- username = ENV['rhel_subscription_user']
- password = ENV['rhel_subscription_pass']
- unless username and password
- raise 'rhel_subscription_user and rhel_subscription_pass are required'
- end
- config.registration.username = username
- config.registration.password = password
- # FIXME this is temporary until vagrant/ansible registration modules
- # are capable of handling specific subscription pools
- if not ENV['rhel_subscription_pool'].nil?
- config.vm.provision "shell" do |s|
- s.inline = "subscription-manager attach --pool=$1 || true"
- s.args = "#{ENV['rhel_subscription_pool']}"
- end
- end
- end
-
config.vm.provider "virtualbox" do |vbox, override|
override.vm.box = "centos/7"
vbox.memory = 1024
diff --git a/git/pylint.sh b/git/pylint.sh
index 55e8b6131..f29c055dc 100755
--- a/git/pylint.sh
+++ b/git/pylint.sh
@@ -40,6 +40,8 @@ for PY_FILE in $PY_DIFF; do
fi
done
+export PYTHONPATH=${WORKSPACE}/utils/src/:${WORKSPACE}/utils/test/
+
if [ "${FILES_TO_TEST}" != "" ]; then
echo "Testing files: ${FILES_TO_TEST}"
exec ${PYTHON} -m pylint --rcfile ${WORKSPACE}/git/.pylintrc ${FILES_TO_TEST}
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 2e1075aca..ae530eadd 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -24,8 +24,25 @@ import StringIO
import yaml
from distutils.util import strtobool
from distutils.version import LooseVersion
-from netaddr import IPNetwork
+import struct
+import socket
+def first_ip(network):
+ """ Return the first IPv4 address in network
+
+ Args:
+ network (str): network in CIDR format
+ Returns:
+ str: first IPv4 address
+ """
+ def atoi(addr):
+ return struct.unpack("!I", socket.inet_aton(addr))[0]
+ def itoa(addr):
+ return socket.inet_ntoa(struct.pack("!I", addr))
+
+ (address, netmask) = network.split('/')
+ netmask_i = (0xffffffff << (32 - atoi(netmask))) & 0xffffffff
+ return itoa((atoi(address) & netmask_i) + 1)
def hostname_valid(hostname):
""" Test if specified hostname should be considered valid
@@ -525,7 +542,7 @@ def set_aggregate_facts(facts):
'kubernetes.default.svc', 'kubernetes.default.svc.' + cluster_domain]
all_hostnames.update(svc_names)
internal_hostnames.update(svc_names)
- first_svc_ip = str(IPNetwork(facts['master']['portal_net'])[1])
+ first_svc_ip = first_ip(facts['master']['portal_net'])
all_hostnames.add(first_svc_ip)
internal_hostnames.add(first_svc_ip)
diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml
index a28aa7ba2..913f0dc78 100644
--- a/roles/openshift_facts/tasks/main.yml
+++ b/roles/openshift_facts/tasks/main.yml
@@ -6,10 +6,9 @@
- ansible_version | version_compare('1.9.0', 'ne')
- ansible_version | version_compare('1.9.0.1', 'ne')
-- name: Ensure python-netaddr and PyYaml are installed
+- name: Ensure PyYaml is installed
yum: pkg={{ item }} state=installed
with_items:
- - python-netaddr
- PyYAML
- name: Gather Cluster facts
diff --git a/roles/rhel_subscribe/tasks/main.yml b/roles/rhel_subscribe/tasks/main.yml
index 8fb2fc042..30c0920a1 100644
--- a/roles/rhel_subscribe/tasks/main.yml
+++ b/roles/rhel_subscribe/tasks/main.yml
@@ -6,19 +6,26 @@
- set_fact:
rhel_subscription_user: "{{ lookup('oo_option', 'rhel_subscription_user') | default(rhsub_user, True) | default(omit, True) }}"
rhel_subscription_pass: "{{ lookup('oo_option', 'rhel_subscription_pass') | default(rhsub_pass, True) | default(omit, True) }}"
+ rhel_subscription_server: "{{ lookup('oo_option', 'rhel_subscription_server') | default(rhsub_server) }}"
- fail:
msg: "This role is only supported for Red Hat hosts"
when: ansible_distribution != 'RedHat'
- fail:
- msg: Either rsub_user or the rhel_subscription_user env variable are required for this role.
+ msg: Either rhsub_user or the rhel_subscription_user env variable are required for this role.
when: rhel_subscription_user is not defined
- fail:
- msg: Either rsub_pass or the rhel_subscription_pass env variable are required for this role.
+ msg: Either rhsub_pass or the rhel_subscription_pass env variable are required for this role.
when: rhel_subscription_pass is not defined
+- name: Satellite preparation
+ command: "rpm -Uvh http://{{ rhel_subscription_server }}/pub/katello-ca-consumer-latest.noarch.rpm"
+ args:
+ creates: /etc/rhsm/ca/katello-server-ca.pem
+ when: rhel_subscription_server is defined and rhel_subscription_server
+
- name: RedHat subscriptions
redhat_subscription:
username: "{{ rhel_subscription_user }}"