Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inventory/dynamic/aws/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ unparsed_is_failed=true

# Additional ssh options for OpenShift Ansible
[ssh_connection]
retries = 10
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=600s
timeout = 10
Expand Down
2 changes: 1 addition & 1 deletion inventory/dynamic/gcp/group_vars/all/00_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ openshift_master_cluster_hostname: "internal-openshift-master.{{ public_hosted_z
openshift_master_cluster_public_hostname: "openshift-master.{{ public_hosted_zone }}"
openshift_master_default_subdomain: "{{ wildcard_zone }}"

mcd_port: 49500
mcd_port: 22623
mcd_endpoint: "https://{{ openshift_master_cluster_public_hostname }}:{{ mcd_port }}"

# Cloud specific settings
Expand Down
44 changes: 42 additions & 2 deletions playbooks/init/basic_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,46 @@
- openshift_deployment_type is undefined
- deployment_type is defined

- name: Read API URL from infra config
hosts: "{{ l_init_fact_hosts | default('nodes') }}"
tasks:
- oc_obj:
name: cluster
kind: infrastructures.config.openshift.io
kubeconfig: "{{ kubeconfig_path }}"
state: present
register: clustercfg
when: kubeconfig_path is defined
until:
- clustercfg.results is defined
- clustercfg.results.returncode is defined
- clustercfg.results.returncode == 0
- clustercfg.results.results is defined
- clustercfg.results.results | length > 0
retries: 36
delay: 5
delegate_to: localhost
- set_fact:
openshift_api_prefix: "{{ clustercfg.results.results[0].status.apiServerURL.split(':')[0:-1] | join(':') }}"

- name: Set worker openshift_bootstrap_endpoint if not already defined
hosts: "{{ l_init_fact_hosts | default('nodes') }}:!masters:!bootstrap"
tasks:
- set_fact:
openshift_bootstrap_endpoint: "{{ openshift_api_prefix }}:22623/config/worker"
when:
- kubeconfig_path is defined
- openshift_bootstrap_endpoint is not defined

- name: Set master openshift_bootstrap_endpoint if not already defined
hosts: "{{ l_init_fact_hosts | default('nodes') }}:&masters"
tasks:
- set_fact:
openshift_bootstrap_endpoint: "{{ openshift_api_prefix }}:22623/config/master"
when:
- kubeconfig_path is defined
- openshift_bootstrap_endpoint is not defined

- name: Read in openshift-install
hosts: "{{ l_init_fact_hosts | default('nodes') }}"
tasks:
Expand All @@ -47,7 +87,7 @@
hosts: "{{ l_init_fact_hosts | default('nodes') }}:!masters:!bootstrap"
tasks:
- set_fact:
openshift_bootstrap_endpoint: "https://{{ openshift_install_config['metadata']['name'] }}-api.{{ openshift_install_config['baseDomain'] }}:49500/config/worker"
openshift_bootstrap_endpoint: "https://api.{{ openshift_install_config['metadata']['name'] }}.{{ openshift_install_config['baseDomain'] }}:22623/config/worker"
when:
- openshift_install_config_path is defined
- openshift_bootstrap_endpoint is not defined
Expand All @@ -56,7 +96,7 @@
hosts: "{{ l_init_fact_hosts | default('nodes') }}:&masters"
tasks:
- set_fact:
openshift_bootstrap_endpoint: "https://{{ openshift_install_config['metadata']['name'] }}-api.{{ openshift_install_config['baseDomain'] }}:49500/config/master"
openshift_bootstrap_endpoint: "https://api.{{ openshift_install_config['metadata']['name'] }}.{{ openshift_install_config['baseDomain'] }}:22623/config/master"
when:
- openshift_install_config_path is defined
- openshift_bootstrap_endpoint is not defined
28 changes: 24 additions & 4 deletions roles/container_runtime/tasks/package_crio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,19 @@
- /etc/cni/net.d/200-loopback.conf
- /etc/cni/net.d/100-crio-bridge.conf

- name: Create the CRI-O configuration
template:
- name: Set pause_image to pod image
ini_file:
dest: /etc/crio/crio.conf
section: "crio.image"
option: pause_image
value: '"{{ openshift_crio_pause_image }}"'

- name: Set pause_command to pod cmd
ini_file:
dest: /etc/crio/crio.conf
src: crio.conf.j2
backup: yes
section: "crio.image"
option: pause_command
value: ' "/usr/bin/pod"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't like the template ?

imo a template would give you a much better flexibility in the long run when things will get much more stable and you will realize you want to do some tuning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't directly control the crio versions, unlike docker, so its best to modify just the required parts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, i was coming from the angle where later the default CRI-O settings won't satisfy the needs of BYO .. i guess we can cross that bridge when we come to it


- name: Update crictl.yaml runtime-endpoint
yedit:
Expand Down Expand Up @@ -89,6 +97,18 @@
state: restarted
daemon_reload: yes
register: start_result
ignore_errors: true

- when: start_result is failed
block:
- name: Get crio logs
command: journalctl --no-pager -u crio
register: crio_logs
ignore_errors: true
- debug:
msg: "{{ crio_logs.stdout_lines }}"
- fail:
msg: crio start failed.

# If we are using crio only, docker.service might not be available for
# 'docker login'
Expand Down
166 changes: 0 additions & 166 deletions roles/container_runtime/templates/crio.conf.j2

This file was deleted.

4 changes: 3 additions & 1 deletion roles/lib_openshift/library/oc_adm_ca_server_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,9 @@ def openshift_installed():
def check_def_equal(user_def, result_def, skip_keys=None, debug=False):
''' Given a user defined definition, compare it with the results given back by our query. '''

if user_def is None:
user_def = {}

# Currently these values are autogenerated and we do not need to check them
skip = ['metadata', 'status']
if skip_keys:
Expand Down Expand Up @@ -1487,7 +1490,6 @@ def stringify(self, ascommalist=''):

return rval


# -*- -*- -*- End included fragment: lib/base.py -*- -*- -*-

# -*- -*- -*- Begin included fragment: class/oc_adm_ca_server_cert.py -*- -*- -*-
Expand Down
4 changes: 3 additions & 1 deletion roles/lib_openshift/library/oc_adm_csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,9 @@ def openshift_installed():
def check_def_equal(user_def, result_def, skip_keys=None, debug=False):
''' Given a user defined definition, compare it with the results given back by our query. '''

if user_def is None:
user_def = {}

# Currently these values are autogenerated and we do not need to check them
skip = ['metadata', 'status']
if skip_keys:
Expand Down Expand Up @@ -1467,7 +1470,6 @@ def stringify(self, ascommalist=''):

return rval


# -*- -*- -*- End included fragment: lib/base.py -*- -*- -*-

# -*- -*- -*- Begin included fragment: class/oc_adm_csr.py -*- -*- -*-
Expand Down
4 changes: 3 additions & 1 deletion roles/lib_openshift/library/oc_adm_manage_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,9 @@ def openshift_installed():
def check_def_equal(user_def, result_def, skip_keys=None, debug=False):
''' Given a user defined definition, compare it with the results given back by our query. '''

if user_def is None:
user_def = {}

# Currently these values are autogenerated and we do not need to check them
skip = ['metadata', 'status']
if skip_keys:
Expand Down Expand Up @@ -1473,7 +1476,6 @@ def stringify(self, ascommalist=''):

return rval


# -*- -*- -*- End included fragment: lib/base.py -*- -*- -*-

# -*- -*- -*- Begin included fragment: class/oc_adm_manage_node.py -*- -*- -*-
Expand Down
4 changes: 3 additions & 1 deletion roles/lib_openshift/library/oc_adm_policy_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,9 @@ def openshift_installed():
def check_def_equal(user_def, result_def, skip_keys=None, debug=False):
''' Given a user defined definition, compare it with the results given back by our query. '''

if user_def is None:
user_def = {}

# Currently these values are autogenerated and we do not need to check them
skip = ['metadata', 'status']
if skip_keys:
Expand Down Expand Up @@ -1465,7 +1468,6 @@ def stringify(self, ascommalist=''):

return rval


# -*- -*- -*- End included fragment: lib/base.py -*- -*- -*-

# -*- -*- -*- Begin included fragment: lib/rolebinding.py -*- -*- -*-
Expand Down
4 changes: 3 additions & 1 deletion roles/lib_openshift/library/oc_adm_policy_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,9 @@ def openshift_installed():
def check_def_equal(user_def, result_def, skip_keys=None, debug=False):
''' Given a user defined definition, compare it with the results given back by our query. '''

if user_def is None:
user_def = {}

# Currently these values are autogenerated and we do not need to check them
skip = ['metadata', 'status']
if skip_keys:
Expand Down Expand Up @@ -1479,7 +1482,6 @@ def stringify(self, ascommalist=''):

return rval


# -*- -*- -*- End included fragment: lib/base.py -*- -*- -*-

# -*- -*- -*- Begin included fragment: lib/rolebinding.py -*- -*- -*-
Expand Down
4 changes: 3 additions & 1 deletion roles/lib_openshift/library/oc_adm_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,9 @@ def openshift_installed():
def check_def_equal(user_def, result_def, skip_keys=None, debug=False):
''' Given a user defined definition, compare it with the results given back by our query. '''

if user_def is None:
user_def = {}

# Currently these values are autogenerated and we do not need to check them
skip = ['metadata', 'status']
if skip_keys:
Expand Down Expand Up @@ -1578,7 +1581,6 @@ def stringify(self, ascommalist=''):

return rval


# -*- -*- -*- End included fragment: lib/base.py -*- -*- -*-

# -*- -*- -*- Begin included fragment: lib/deploymentconfig.py -*- -*- -*-
Expand Down
Loading