summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/byo/rhel_subscribe.yml3
-rw-r--r--playbooks/init/main.yml2
-rw-r--r--playbooks/init/repos.yml4
-rw-r--r--playbooks/init/validate_hostnames.yml34
-rw-r--r--playbooks/openshift-node/private/restart.yml1
-rw-r--r--playbooks/prerequisites.yml2
6 files changed, 34 insertions, 12 deletions
diff --git a/playbooks/byo/rhel_subscribe.yml b/playbooks/byo/rhel_subscribe.yml
index 5a877809a..3cb11a457 100644
--- a/playbooks/byo/rhel_subscribe.yml
+++ b/playbooks/byo/rhel_subscribe.yml
@@ -8,6 +8,7 @@
when:
- deployment_type == 'openshift-enterprise'
- ansible_distribution == "RedHat"
- - lookup('env', 'rhel_skip_subscription') | default(rhsub_skip, True) | default('no', True) | lower in ['no', 'false']
+ - rhsub_user | default(False)
+ - rhsub_pass | default(False)
- role: openshift_repos
- role: os_update_latest
diff --git a/playbooks/init/main.yml b/playbooks/init/main.yml
index b2b972a7d..06e8ba504 100644
--- a/playbooks/init/main.yml
+++ b/playbooks/init/main.yml
@@ -23,8 +23,6 @@
- import_playbook: validate_hostnames.yml
when: not (skip_validate_hostnames | default(False))
-- import_playbook: repos.yml
-
- import_playbook: version.yml
when: not (skip_verison | default(False))
diff --git a/playbooks/init/repos.yml b/playbooks/init/repos.yml
index 4967b8f13..048b09e60 100644
--- a/playbooks/init/repos.yml
+++ b/playbooks/init/repos.yml
@@ -9,8 +9,8 @@
when:
- ansible_distribution == 'RedHat'
- deployment_type == 'openshift-enterprise'
- - (rhel_subscription_user or rhsub_user) is defined
- - (rhel_subscription_password or rhsub_pass) is defined
+ - rhsub_user | default(False)
+ - rhsub_pass | default(False)
- name: initialize openshift repos
include_role:
name: openshift_repos
diff --git a/playbooks/init/validate_hostnames.yml b/playbooks/init/validate_hostnames.yml
index be2e6a15a..86e0b2416 100644
--- a/playbooks/init/validate_hostnames.yml
+++ b/playbooks/init/validate_hostnames.yml
@@ -1,6 +1,7 @@
---
- name: Validate node hostnames
hosts: oo_nodes_to_config
+ any_errors_fatal: true
tasks:
- name: Query DNS for IP address of {{ openshift.common.hostname }}
shell:
@@ -8,16 +9,35 @@
register: lookupip
changed_when: false
failed_when: false
- - name: Warn user about bad openshift_hostname values
- pause:
- prompt:
+
+ - name: Validate openshift_hostname when defined
+ fail:
+ msg: >
The hostname {{ openshift.common.hostname }} for {{ ansible_nodename }}
doesn't resolve to an IP address owned by this host. Please set
openshift_hostname variable to a hostname that when resolved on the host
- in question resolves to an IP address matching an interface on this
- host. This host will fail liveness checks for pods utilizing hostPorts,
- press ENTER to continue or CTRL-C to abort.
- seconds: "{{ 10 if openshift_override_hostname_check | default(false) | bool else omit }}"
+ in question resolves to an IP address matching an interface on this host.
+ This will ensure proper functionality of OpenShift networking features.
+ Inventory setting: openshift_hostname={{ openshift_hostname }}
+ This check can be overridden by setting openshift_hostname_check=false in
+ the inventory.
+ See https://docs.openshift.org/latest/install_config/install/advanced_install.html#configuring-host-variables
when:
- lookupip.stdout != '127.0.0.1'
- lookupip.stdout not in ansible_all_ipv4_addresses
+ - openshift_hostname_check | default(true)
+
+ - name: Validate openshift_ip exists on node when defined
+ fail:
+ msg: >
+ The IP address {{ openshift_ip }} does not exist on {{ ansible_nodename }}.
+ Please set the openshift_ip variable to an IP address of this node.
+ This will ensure proper functionality of OpenShift networking features.
+ Inventory setting: openshift_ip={{ openshift_ip }}
+ This check can be overridden by setting openshift_ip_check=false in
+ the inventory.
+ See https://docs.openshift.org/latest/install_config/install/advanced_install.html#configuring-host-variables
+ when:
+ - openshift_ip is defined
+ - openshift_ip not in ansible_all_ipv4_addresses
+ - openshift_ip_check | default(true)
diff --git a/playbooks/openshift-node/private/restart.yml b/playbooks/openshift-node/private/restart.yml
index 0786bd7d3..6a10585b9 100644
--- a/playbooks/openshift-node/private/restart.yml
+++ b/playbooks/openshift-node/private/restart.yml
@@ -5,6 +5,7 @@
roles:
- lib_openshift
+ - openshift_facts
tasks:
- name: Restart docker
diff --git a/playbooks/prerequisites.yml b/playbooks/prerequisites.yml
index 7b7868cfe..5ba62a6d6 100644
--- a/playbooks/prerequisites.yml
+++ b/playbooks/prerequisites.yml
@@ -3,6 +3,8 @@
vars:
skip_verison: True
+- import_playbook: init/repos.yml
+
# This is required for container runtime for crio, only needs to run once.
- name: Configure os_firewall
hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_nfs_to_config:oo_nodes_to_config