summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.tito/packages/openshift-ansible2
-rw-r--r--openshift-ansible.spec8
-rw-r--r--playbooks/common/openshift-cluster/upgrades/init.yml1
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml5
-rw-r--r--playbooks/container-runtime/private/config.yml6
-rw-r--r--playbooks/init/base_packages.yml5
-rw-r--r--playbooks/openshift-etcd/scaleup.yml1
-rw-r--r--playbooks/openshift-master/scaleup.yml1
-rw-r--r--playbooks/openshift-node/scaleup.yml1
-rw-r--r--playbooks/openshift-prometheus/private/uninstall.yml2
-rw-r--r--roles/openshift_aws/tasks/seal_ami.yml15
-rw-r--r--roles/openshift_master_certificates/tasks/main.yml25
-rw-r--r--roles/openshift_node/defaults/main.yml2
-rw-r--r--roles/openshift_node/tasks/bootstrap.yml4
-rw-r--r--roles/openshift_prometheus/tasks/uninstall_prometheus.yaml (renamed from roles/openshift_prometheus/tasks/uninstall.yaml)0
-rw-r--r--roles/openshift_provisioners/defaults/main.yaml2
-rw-r--r--roles/openshift_storage_glusterfs/tasks/heketi_deploy_part2.yml2
-rw-r--r--roles/openshift_web_console/files/console-template.yaml15
-rw-r--r--roles/openshift_web_console/tasks/update_console_config.yml7
-rw-r--r--roles/openshift_web_console/vars/openshift-enterprise.yml2
-rw-r--r--utils/src/ooinstall/cli_installer.py11
-rw-r--r--utils/src/ooinstall/openshift_ansible.py17
-rw-r--r--utils/test/cli_installer_tests.py115
23 files changed, 172 insertions, 77 deletions
diff --git a/.tito/packages/openshift-ansible b/.tito/packages/openshift-ansible
index 35f5ec66f..1266921a6 100644
--- a/.tito/packages/openshift-ansible
+++ b/.tito/packages/openshift-ansible
@@ -1 +1 @@
-3.9.0-0.40.0 ./
+3.9.0-0.41.0 ./
diff --git a/openshift-ansible.spec b/openshift-ansible.spec
index 81bf730f7..ae0104b27 100644
--- a/openshift-ansible.spec
+++ b/openshift-ansible.spec
@@ -10,7 +10,7 @@
Name: openshift-ansible
Version: 3.9.0
-Release: 0.40.0%{?dist}
+Release: 0.41.0%{?dist}
Summary: Openshift and Atomic Enterprise Ansible
License: ASL 2.0
URL: https://github.com/openshift/openshift-ansible
@@ -201,6 +201,12 @@ Atomic OpenShift Utilities includes
%changelog
+* Wed Feb 07 2018 Justin Pierce <jupierce@redhat.com> 3.9.0-0.41.0
+- Allow OVS 2.7 in OCP 3.10 (sdodson@redhat.com)
+- GlusterFS: Minor documentation update (jarrpa@redhat.com)
+- Make sure to include upgrade_pre when upgrading master nodes
+ (sdodson@redhat.com)
+
* Wed Feb 07 2018 Justin Pierce <jupierce@redhat.com> 3.9.0-0.40.0
- health checks: tolerate ovs 2.9 (lmeyer@redhat.com)
- Fix docker rpm upgrade install task wording (mgugino@redhat.com)
diff --git a/playbooks/common/openshift-cluster/upgrades/init.yml b/playbooks/common/openshift-cluster/upgrades/init.yml
index ba783638d..a9a35b028 100644
--- a/playbooks/common/openshift-cluster/upgrades/init.yml
+++ b/playbooks/common/openshift-cluster/upgrades/init.yml
@@ -6,6 +6,7 @@
g_new_node_hosts: []
- import_playbook: ../../../init/basic_facts.yml
+- import_playbook: ../../../init/base_packages.yml
- import_playbook: ../../../init/cluster_facts.yml
- name: Ensure firewall is not switched during upgrade
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml
index 8792295c6..9c7677f1b 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml
@@ -15,6 +15,7 @@
vars:
l_upgrade_no_switch_firewall_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
+ l_base_packages_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
## Check to see if they're running 3.7 and if so upgrade them to 3.8 on control plan
## If they've specified pkg_version or image_tag preserve that for later use
@@ -125,8 +126,8 @@
- name: Restart master controllers to force new leader election mode
service:
name: "{{ openshift_service_type }}-master-controllers"
- state: restart
- when: openshift.common.rolling_restart_mode == 'service'
+ state: restarted
+ when: openshift.common.rolling_restart_mode == 'services'
- name: Re-enable master controllers to force new leader election mode
service:
name: "{{ openshift_service_type }}-master-controllers"
diff --git a/playbooks/container-runtime/private/config.yml b/playbooks/container-runtime/private/config.yml
index 5396df20a..d5312de15 100644
--- a/playbooks/container-runtime/private/config.yml
+++ b/playbooks/container-runtime/private/config.yml
@@ -12,6 +12,12 @@
- role: container_runtime
tasks:
- import_role:
+ name: openshift_excluder
+ tasks_from: enable.yml
+ vars:
+ r_openshift_excluder_action: enable
+ r_openshift_excluder_enable_openshift_excluder: false
+ - import_role:
name: container_runtime
tasks_from: package_docker.yml
when:
diff --git a/playbooks/init/base_packages.yml b/playbooks/init/base_packages.yml
index 81f4dd183..addb4f44d 100644
--- a/playbooks/init/base_packages.yml
+++ b/playbooks/init/base_packages.yml
@@ -1,8 +1,9 @@
---
-# l_scale_up_hosts may be passed in via prerequisites.yml during scaleup plays.
+# l_base_packages_hosts may be passed in via prerequisites.yml during scaleup plays
+# and upgrade_control_plane.yml upgrade plays.
- name: Install packages necessary for installer
- hosts: "{{ l_scale_up_hosts | default('oo_all_hosts') }}"
+ hosts: "{{ l_base_packages_hosts | default('oo_all_hosts') }}"
any_errors_fatal: true
tasks:
- when:
diff --git a/playbooks/openshift-etcd/scaleup.yml b/playbooks/openshift-etcd/scaleup.yml
index 656454fe3..1f8cb7391 100644
--- a/playbooks/openshift-etcd/scaleup.yml
+++ b/playbooks/openshift-etcd/scaleup.yml
@@ -32,6 +32,7 @@
l_build_container_groups_hosts: "oo_new_etcd_to_config"
l_etcd_scale_up_hosts: "oo_hosts_containerized_managed_true"
l_scale_up_hosts: "oo_new_etcd_to_config"
+ l_base_packages_hosts: "oo_new_etcd_to_config"
l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_new_etcd_to_config"
l_sanity_check_hosts: "{{ groups['oo_new_etcd_to_config'] | union(groups['oo_masters_to_config']) | union(groups['oo_etcd_to_config']) }}"
when:
diff --git a/playbooks/openshift-master/scaleup.yml b/playbooks/openshift-master/scaleup.yml
index 09e205afc..0ca5d1a61 100644
--- a/playbooks/openshift-master/scaleup.yml
+++ b/playbooks/openshift-master/scaleup.yml
@@ -32,6 +32,7 @@
- import_playbook: ../prerequisites.yml
vars:
l_scale_up_hosts: "oo_nodes_to_config:oo_masters_to_config"
+ l_base_packages_hosts: "oo_nodes_to_config:oo_masters_to_config"
l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_nodes_to_config"
l_sanity_check_hosts: "{{ groups['oo_nodes_to_config'] | union(groups['oo_masters_to_config']) }}"
diff --git a/playbooks/openshift-node/scaleup.yml b/playbooks/openshift-node/scaleup.yml
index 9cc7263b7..bda251fa5 100644
--- a/playbooks/openshift-node/scaleup.yml
+++ b/playbooks/openshift-node/scaleup.yml
@@ -27,6 +27,7 @@
- import_playbook: ../prerequisites.yml
vars:
l_scale_up_hosts: "oo_nodes_to_config"
+ l_base_packages_hosts: "oo_nodes_to_config"
l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_nodes_to_config"
l_sanity_check_hosts: "{{ groups['oo_nodes_to_config'] | union(groups['oo_masters_to_config']) }}"
diff --git a/playbooks/openshift-prometheus/private/uninstall.yml b/playbooks/openshift-prometheus/private/uninstall.yml
index 2df39c2a8..b01f7f988 100644
--- a/playbooks/openshift-prometheus/private/uninstall.yml
+++ b/playbooks/openshift-prometheus/private/uninstall.yml
@@ -5,4 +5,4 @@
- name: Run the Prometheus Uninstall Role Tasks
include_role:
name: openshift_prometheus
- tasks_from: uninstall
+ tasks_from: uninstall_prometheus
diff --git a/roles/openshift_aws/tasks/seal_ami.yml b/roles/openshift_aws/tasks/seal_ami.yml
index 74877d5c7..c1cb37a3b 100644
--- a/roles/openshift_aws/tasks/seal_ami.yml
+++ b/roles/openshift_aws/tasks/seal_ami.yml
@@ -10,6 +10,19 @@
delay: 3
until: instancesout.instances|length > 0
+- name: fetch the ami used to create the instance
+ ec2_ami_find:
+ region: "{{ openshift_aws_region }}"
+ ami_id: "{{ instancesout.instances[0]['image_id'] }}"
+ register: original_ami_out
+ retries: 20
+ delay: 3
+ until: original_ami_out.results|length > 0
+
+- name: combine the tags of the original ami with newly created ami
+ set_fact:
+ l_openshift_aws_ami_tags: "{{ original_ami_out.results[0]['tags'] | combine(openshift_aws_ami_tags) }}"
+
- name: bundle ami
ec2_ami:
instance_id: "{{ instancesout.instances.0.instance_id }}"
@@ -17,7 +30,7 @@
state: present
description: "This was provisioned {{ ansible_date_time.iso8601 }}"
name: "{{ openshift_aws_ami_name }}"
- tags: "{{ openshift_aws_ami_tags }}"
+ tags: "{{ l_openshift_aws_ami_tags }}"
wait: yes
register: amioutput
diff --git a/roles/openshift_master_certificates/tasks/main.yml b/roles/openshift_master_certificates/tasks/main.yml
index ce27e238f..a92b63979 100644
--- a/roles/openshift_master_certificates/tasks/main.yml
+++ b/roles/openshift_master_certificates/tasks/main.yml
@@ -1,25 +1,16 @@
---
-- set_fact:
- openshift_master_certs_no_etcd:
- - admin.crt
- - master.kubelet-client.crt
- - master.proxy-client.crt
- - master.server.crt
- - openshift-master.crt
- - openshift-registry.crt
- - openshift-router.crt
- - etcd.server.crt
- openshift_master_certs_etcd:
- - master.etcd-client.crt
-
-- set_fact:
- openshift_master_certs: "{{ (openshift_master_certs_no_etcd | union(openshift_master_certs_etcd )) if openshift_master_etcd_hosts | length > 0 else openshift_master_certs_no_etcd }}"
-
- name: Check status of master certificates
stat:
path: "{{ openshift_master_config_dir }}/{{ item }}"
with_items:
- - "{{ openshift_master_certs }}"
+ - admin.crt
+ - ca.crt
+ - ca-bundle.crt
+ - master.kubelet-client.crt
+ - master.proxy-client.crt
+ - master.server.crt
+ - openshift-master.crt
+ - service-signer.crt
register: g_master_cert_stat_result
when: not openshift_certificates_redeploy | default(false) | bool
diff --git a/roles/openshift_node/defaults/main.yml b/roles/openshift_node/defaults/main.yml
index 9f887891b..64ab07bb5 100644
--- a/roles/openshift_node/defaults/main.yml
+++ b/roles/openshift_node/defaults/main.yml
@@ -112,7 +112,7 @@ l_is_openvswitch_system_container: "{{ (openshift_use_openvswitch_system_contain
openshift_image_tag: ''
default_r_openshift_node_image_prep_packages:
-- "{{ openshift_service_type }}-master"
+#- "{{ openshift_service_type }}-master"
- "{{ openshift_service_type }}-node"
- "{{ openshift_service_type }}-docker-excluder"
- "{{ openshift_service_type }}-sdn-ovs"
diff --git a/roles/openshift_node/tasks/bootstrap.yml b/roles/openshift_node/tasks/bootstrap.yml
index 1a6f209e0..f9f042eeb 100644
--- a/roles/openshift_node/tasks/bootstrap.yml
+++ b/roles/openshift_node/tasks/bootstrap.yml
@@ -43,13 +43,13 @@
# line: "{% raw %}ExecStart=/usr/bin/openshift start node --bootstrap --kubeconfig=${KUBECONFIG} $OPTIONS{% endraw %}"
# regexp: "^ExecStart=.*"
-- name: "disable {{ openshift_service_type }}-node and {{ openshift_service_type }}-master services"
+- name: "disable {{ openshift_service_type }}-node" # and {{ openshift_service_type }}-master services"
systemd:
name: "{{ item }}"
enabled: no
with_items:
- "{{ openshift_service_type }}-node.service"
- - "{{ openshift_service_type }}-master.service"
+# - "{{ openshift_service_type }}-master.service"
- name: Check for RPM generated config marker file .config_managed
stat:
diff --git a/roles/openshift_prometheus/tasks/uninstall.yaml b/roles/openshift_prometheus/tasks/uninstall_prometheus.yaml
index d746402db..d746402db 100644
--- a/roles/openshift_prometheus/tasks/uninstall.yaml
+++ b/roles/openshift_prometheus/tasks/uninstall_prometheus.yaml
diff --git a/roles/openshift_provisioners/defaults/main.yaml b/roles/openshift_provisioners/defaults/main.yaml
index 34ba78404..a54bf6de2 100644
--- a/roles/openshift_provisioners/defaults/main.yaml
+++ b/roles/openshift_provisioners/defaults/main.yaml
@@ -11,7 +11,7 @@ openshift_provisioners_project: openshift-infra
openshift_provisioners_image_prefix_dict:
origin: "docker.io/openshift/origin-"
- openshift-enterprise: "registry.access.redhat.com/openshift3/ose-"
+ openshift-enterprise: "registry.access.redhat.com/openshift3/"
openshift_provisioners_image_version_dict:
origin: "latest"
diff --git a/roles/openshift_storage_glusterfs/tasks/heketi_deploy_part2.yml b/roles/openshift_storage_glusterfs/tasks/heketi_deploy_part2.yml
index c0a8c53de..303589617 100644
--- a/roles/openshift_storage_glusterfs/tasks/heketi_deploy_part2.yml
+++ b/roles/openshift_storage_glusterfs/tasks/heketi_deploy_part2.yml
@@ -1,6 +1,6 @@
---
- name: Create heketi DB volume
- command: "{{ glusterfs_heketi_client }} setup-openshift-heketi-storage --listfile /tmp/heketi-storage.json"
+ command: "{{ glusterfs_heketi_client }} setup-openshift-heketi-storage --image {{ glusterfs_heketi_image}}:{{ glusterfs_heketi_version }} --listfile /tmp/heketi-storage.json"
register: setup_storage
- name: Copy heketi-storage list
diff --git a/roles/openshift_web_console/files/console-template.yaml b/roles/openshift_web_console/files/console-template.yaml
index 547e7a265..5bcfcf73f 100644
--- a/roles/openshift_web_console/files/console-template.yaml
+++ b/roles/openshift_web_console/files/console-template.yaml
@@ -67,10 +67,17 @@ objects:
port: 8443
scheme: HTTPS
livenessProbe:
- httpGet:
- path: /
- port: 8443
- scheme: HTTPS
+ exec:
+ command:
+ - /bin/sh
+ - -i
+ - -c
+ - |-
+ if [[ ! -f /tmp/webconsole-config.hash ]]; then \
+ md5sum /var/webconsole-config/webconsole-config.yaml > /tmp/webconsole-config.hash; \
+ elif [[ $(md5sum /var/webconsole-config/webconsole-config.yaml) != $(cat /tmp/webconsole-config.hash) ]]; then \
+ exit 1; \
+ fi && curl -k -f https://0.0.0.0:8443/console/
resources:
requests:
cpu: 100m
diff --git a/roles/openshift_web_console/tasks/update_console_config.yml b/roles/openshift_web_console/tasks/update_console_config.yml
index 967222ea4..8b967cda3 100644
--- a/roles/openshift_web_console/tasks/update_console_config.yml
+++ b/roles/openshift_web_console/tasks/update_console_config.yml
@@ -5,9 +5,6 @@
# `value` properties in the same format as `yedit` module `edits`. Only
# properties passed are updated. The separator for nested properties is `#`.
#
-# Note that this triggers a redeployment on the console and a brief downtime
-# since it uses a `Recreate` strategy.
-#
# Example usage:
#
# - include_role:
@@ -55,13 +52,9 @@
state: present
from_file:
webconsole-config.yaml: "{{ mktemp_console.stdout }}/webconsole-config.yaml"
- register: update_console_config_map
- name: Remove temp directory
file:
state: absent
name: "{{ mktemp_console.stdout }}"
changed_when: False
-
- - include_tasks: rollout_console.yml
- when: update_console_config_map.changed | bool
diff --git a/roles/openshift_web_console/vars/openshift-enterprise.yml b/roles/openshift_web_console/vars/openshift-enterprise.yml
index d0bb61a56..375c22067 100644
--- a/roles/openshift_web_console/vars/openshift-enterprise.yml
+++ b/roles/openshift_web_console/vars/openshift-enterprise.yml
@@ -1,4 +1,4 @@
---
__openshift_web_console_prefix: "registry.access.redhat.com/openshift3/ose-"
-__openshift_web_console_version: "v3.10"
+__openshift_web_console_version: "v3.9"
__openshift_web_console_image_name: "web-console"
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py
index eb42721b5..ffab3bfbf 100644
--- a/utils/src/ooinstall/cli_installer.py
+++ b/utils/src/ooinstall/cli_installer.py
@@ -796,6 +796,17 @@ If changes are needed please edit the installer.cfg.yml config file above and re
if not unattended:
confirm_continue(message)
+ error = openshift_ansible.run_prerequisites(inventory_file, oo_cfg.deployment.hosts,
+ hosts_to_run_on, verbose)
+ if error:
+ # The bootstrap script will print out the log location.
+ message = """
+An error was detected. After resolving the problem please relaunch the
+installation process.
+"""
+ click.echo(message)
+ sys.exit(1)
+
error = openshift_ansible.run_main_playbook(inventory_file, oo_cfg.deployment.hosts,
hosts_to_run_on, verbose)
diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py
index 84a76fa53..5e1ad09d5 100644
--- a/utils/src/ooinstall/openshift_ansible.py
+++ b/utils/src/ooinstall/openshift_ansible.py
@@ -275,6 +275,21 @@ def default_facts(hosts, verbose=False):
return load_system_facts(inventory_file, os_facts_path, facts_env, verbose)
+def run_prerequisites(inventory_file, hosts, hosts_to_run_on, verbose=False):
+ global CFG
+ prerequisites_playbook_path = os.path.join(CFG.ansible_playbook_directory,
+ 'playbooks/prerequisites.yml')
+ facts_env = os.environ.copy()
+ if 'ansible_log_path' in CFG.settings:
+ facts_env['ANSIBLE_LOG_PATH'] = CFG.settings['ansible_log_path']
+
+ # override the ansible config for prerequisites playbook run
+ if 'ansible_quiet_config' in CFG.settings:
+ facts_env['ANSIBLE_CONFIG'] = CFG.settings['ansible_quiet_config']
+
+ return run_ansible(prerequisites_playbook_path, inventory_file, facts_env, verbose)
+
+
def run_main_playbook(inventory_file, hosts, hosts_to_run_on, verbose=False):
global CFG
if len(hosts_to_run_on) != len(hosts):
@@ -282,7 +297,7 @@ def run_main_playbook(inventory_file, hosts, hosts_to_run_on, verbose=False):
'playbooks/openshift-node/scaleup.yml')
else:
main_playbook_path = os.path.join(CFG.ansible_playbook_directory,
- 'playbooks/byo/openshift-cluster/config.yml')
+ 'playbooks/deploy_cluster.yml')
facts_env = os.environ.copy()
if 'ansible_log_path' in CFG.settings:
facts_env['ANSIBLE_LOG_PATH'] = CFG.settings['ansible_log_path']
diff --git a/utils/test/cli_installer_tests.py b/utils/test/cli_installer_tests.py
index 2259f3416..e5e66c1ee 100644
--- a/utils/test/cli_installer_tests.py
+++ b/utils/test/cli_installer_tests.py
@@ -393,14 +393,16 @@ class UnattendedCliTests(OOCliFixture):
# unattended with config file and all installed hosts (without --force)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_get_hosts_to_run_on1(self, load_facts_mock, run_playbook_mock):
+ def test_get_hosts_to_run_on1(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
mock_facts = copy.deepcopy(MOCK_FACTS)
mock_facts['10.0.0.1']['common']['version'] = "3.0.0"
mock_facts['10.0.0.2']['common']['version'] = "3.0.0"
mock_facts['10.0.0.3']['common']['version'] = "3.0.0"
load_facts_mock.return_value = (mock_facts, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -415,12 +417,15 @@ class UnattendedCliTests(OOCliFixture):
# unattended with config file and all installed hosts (with --force)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_get_hosts_to_run_on2(self, load_facts_mock, run_playbook_mock):
+ def test_get_hosts_to_run_on2(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
mock_facts = copy.deepcopy(MOCK_FACTS)
mock_facts['10.0.0.1']['common']['version'] = "3.0.0"
mock_facts['10.0.0.2']['common']['version'] = "3.0.0"
mock_facts['10.0.0.3']['common']['version'] = "3.0.0"
+ prerequisites_mock.return_value = 0
+
self._verify_get_hosts_to_run_on(mock_facts, load_facts_mock, run_playbook_mock,
cli_input=None,
exp_hosts_len=3,
@@ -429,9 +434,11 @@ class UnattendedCliTests(OOCliFixture):
# unattended with config file and no installed hosts (without --force)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_get_hosts_to_run_on3(self, load_facts_mock, run_playbook_mock):
+ def test_get_hosts_to_run_on3(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
self._verify_get_hosts_to_run_on(MOCK_FACTS, load_facts_mock, run_playbook_mock,
cli_input=None,
@@ -441,9 +448,11 @@ class UnattendedCliTests(OOCliFixture):
# unattended with config file and no installed hosts (with --force)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_get_hosts_to_run_on4(self, load_facts_mock, run_playbook_mock):
+ def test_get_hosts_to_run_on4(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
self._verify_get_hosts_to_run_on(MOCK_FACTS, load_facts_mock, run_playbook_mock,
cli_input=None,
@@ -453,8 +462,9 @@ class UnattendedCliTests(OOCliFixture):
# unattended with config file and some installed some uninstalled hosts (without --force)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_get_hosts_to_run_on5(self, load_facts_mock, run_playbook_mock):
+ def test_get_hosts_to_run_on5(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
mock_facts = copy.deepcopy(MOCK_FACTS)
mock_facts['10.0.0.1']['common']['version'] = "3.0.0"
mock_facts['10.0.0.2']['common']['version'] = "3.0.0"
@@ -465,22 +475,24 @@ class UnattendedCliTests(OOCliFixture):
force=False)
# unattended with config file and some installed some uninstalled hosts (with --force)
- @patch('ooinstall.openshift_ansible.run_main_playbook')
- @patch('ooinstall.openshift_ansible.load_system_facts')
- def test_get_hosts_to_run_on6(self, load_facts_mock, run_playbook_mock):
- mock_facts = copy.deepcopy(MOCK_FACTS)
- mock_facts['10.0.0.1']['common']['version'] = "3.0.0"
- mock_facts['10.0.0.2']['common']['version'] = "3.0.0"
- self._verify_get_hosts_to_run_on(mock_facts, load_facts_mock, run_playbook_mock,
- cli_input=None,
- exp_hosts_len=3,
- exp_hosts_to_run_on_len=3,
- force=True)
+ # @patch('ooinstall.openshift_ansible.run_main_playbook')
+ # @patch('ooinstall.openshift_ansible.load_system_facts')
+ # def test_get_hosts_to_run_on6(self, load_facts_mock, run_playbook_mock):
+ # mock_facts = copy.deepcopy(MOCK_FACTS)
+ # mock_facts['10.0.0.1']['common']['version'] = "3.0.0"
+ # mock_facts['10.0.0.2']['common']['version'] = "3.0.0"
+ # self._verify_get_hosts_to_run_on(mock_facts, load_facts_mock, run_playbook_mock,
+ # cli_input=None,
+ # exp_hosts_len=3,
+ # exp_hosts_to_run_on_len=3,
+ # force=True)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_cfg_full_run(self, load_facts_mock, run_playbook_mock):
+ def test_cfg_full_run(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -514,10 +526,12 @@ class UnattendedCliTests(OOCliFixture):
self.assertEquals(3, len(hosts_to_run_on))
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_inventory_write(self, load_facts_mock, run_playbook_mock):
+ def test_inventory_write(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
merged_config = SAMPLE_CONFIG % 'openshift-enterprise'
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -551,9 +565,11 @@ class UnattendedCliTests(OOCliFixture):
self.assertTrue('openshift_public_hostname' in master_line)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_variant_version_latest_assumed(self, load_facts_mock, run_playbook_mock):
+ def test_variant_version_latest_assumed(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -578,9 +594,11 @@ class UnattendedCliTests(OOCliFixture):
inventory.get('OSEv3:vars', 'deployment_type'))
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_variant_version_preserved(self, load_facts_mock, run_playbook_mock):
+ def test_variant_version_preserved(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config = SAMPLE_CONFIG % 'openshift-enterprise'
@@ -606,9 +624,11 @@ class UnattendedCliTests(OOCliFixture):
# unattended with bad config file and no installed hosts (without --force)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_bad_config(self, load_facts_mock, run_playbook_mock):
+ def test_bad_config(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -625,9 +645,11 @@ class UnattendedCliTests(OOCliFixture):
# unattended with three masters, one node, and haproxy
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_quick_ha_full_run(self, load_facts_mock, run_playbook_mock):
+ def test_quick_ha_full_run(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -646,9 +668,11 @@ class UnattendedCliTests(OOCliFixture):
# unattended with two masters, one node, and haproxy
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_quick_ha_only_2_masters(self, load_facts_mock, run_playbook_mock):
+ def test_quick_ha_only_2_masters(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -664,9 +688,11 @@ class UnattendedCliTests(OOCliFixture):
# unattended with three masters, one node, but no load balancer specified:
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_quick_ha_no_lb(self, load_facts_mock, run_playbook_mock):
+ def test_quick_ha_no_lb(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -682,9 +708,11 @@ class UnattendedCliTests(OOCliFixture):
# unattended with three masters, one node, and one of the masters reused as load balancer:
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_quick_ha_reused_lb(self, load_facts_mock, run_playbook_mock):
+ def test_quick_ha_reused_lb(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -699,9 +727,11 @@ class UnattendedCliTests(OOCliFixture):
# unattended with preconfigured lb
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_quick_ha_preconfigured_lb(self, load_facts_mock, run_playbook_mock):
+ def test_quick_ha_preconfigured_lb(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(
@@ -728,9 +758,11 @@ class AttendedCliTests(OOCliFixture):
self.cli_args.extend(["-c", self.config_file])
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_full_run(self, load_facts_mock, run_playbook_mock):
+ def test_full_run(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
cli_input = build_input(
@@ -764,8 +796,9 @@ class AttendedCliTests(OOCliFixture):
# interactive with config file and some installed some uninstalled hosts
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_scaleup_hint(self, load_facts_mock, run_playbook_mock):
+ def test_scaleup_hint(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
# Modify the mock facts to return a version indicating OpenShift
# is already installed on our master, and the first node.
@@ -774,6 +807,7 @@ class AttendedCliTests(OOCliFixture):
mock_facts['10.0.0.2']['common']['version'] = "3.0.0"
load_facts_mock.return_value = (mock_facts, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
cli_input = build_input(
@@ -797,9 +831,11 @@ class AttendedCliTests(OOCliFixture):
self.assert_result(result, 1)
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_fresh_install_with_config(self, load_facts_mock, run_playbook_mock):
+ def test_fresh_install_with_config(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
config_file = self.write_config(os.path.join(self.work_dir,
@@ -821,6 +857,7 @@ class AttendedCliTests(OOCliFixture):
# #interactive with config file and all installed hosts
# @patch('ooinstall.openshift_ansible.run_main_playbook')
+# @patch('ooinstall.openshift_ansible.run_prerequisites')
# @patch('ooinstall.openshift_ansible.load_system_facts')
# def test_get_hosts_to_run_on(self, load_facts_mock, run_playbook_mock):
# mock_facts = copy.deepcopy(MOCK_FACTS)
@@ -846,9 +883,11 @@ class AttendedCliTests(OOCliFixture):
# interactive multimaster: one more node than master
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_ha_dedicated_node(self, load_facts_mock, run_playbook_mock):
+ def test_ha_dedicated_node(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
cli_input = build_input(
@@ -889,9 +928,11 @@ class AttendedCliTests(OOCliFixture):
# interactive multimaster: identical masters and nodes
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_ha_no_dedicated_nodes(self, load_facts_mock, run_playbook_mock):
+ def test_ha_no_dedicated_nodes(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
cli_input = build_input(
@@ -958,9 +999,11 @@ class AttendedCliTests(OOCliFixture):
# interactive multimaster: attempting to use a master as the load balancer should fail:
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_ha_reuse_master_as_lb(self, load_facts_mock, run_playbook_mock):
+ def test_ha_reuse_master_as_lb(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
cli_input = build_input(
@@ -981,9 +1024,11 @@ class AttendedCliTests(OOCliFixture):
# interactive all-in-one
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_all_in_one(self, load_facts_mock, run_playbook_mock):
+ def test_all_in_one(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
cli_input = build_input(
@@ -1010,9 +1055,11 @@ class AttendedCliTests(OOCliFixture):
'openshift_schedulable=True')
@patch('ooinstall.openshift_ansible.run_main_playbook')
+ @patch('ooinstall.openshift_ansible.run_prerequisites')
@patch('ooinstall.openshift_ansible.load_system_facts')
- def test_gen_inventory(self, load_facts_mock, run_playbook_mock):
+ def test_gen_inventory(self, load_facts_mock, prerequisites_mock, run_playbook_mock):
load_facts_mock.return_value = (MOCK_FACTS, 0)
+ prerequisites_mock.return_value = 0
run_playbook_mock.return_value = 0
cli_input = build_input(