Role - kubeinit_okd

Role Documentation

Please, refer to the kubeinit_okd role official docs for further information.

Role Defaults

This section highlights all of the defaults and variables set within the “kubeinit_okd” role.

# All variables intended for modification should be placed in this file.

# All variables within this role should have a prefix of "kubeinit_okd_"
kubeinit_okd_debug: '{{ (ansible_verbosity | int) >= 2 | bool }}'
kubeinit_okd_hide_sensitive_logs: true

kubeinit_okd_pod_cidr: 10.100.0.0/14
kubeinit_okd_service_cidr: 172.30.0.0/16

kubeinit_okd_wait_for_cluster_to_converge: true

###########################################
# If you need to deploy openshift instead #
# This will override the OKD deployment   #
###########################################
kubeinit_okd_openshift_deploy: '{{ kubeinit_common_openshift_deploy }}'
kubeinit_okd_openshift_pullsecret: '{{ kubeinit_common_openshift_pullsecret }}'
kubeinit_okd_openshift_registry_token_cloud_openshift_com: THIS_IS_AN_EXAMPLE_TOKEN_FOR_CLOUD_OPENSHIFT_COM
kubeinit_okd_openshift_registry_token_quay_io: THIS_IS_AN_EXAMPLE_TOKEN_FOR_QUAY_IO
kubeinit_okd_openshift_registry_token_registry_connect_redhat_com: THIS_IS_AN_EXAMPLE_TOKEN_FOR_CONNECT_REDHAT_COM
kubeinit_okd_openshift_registry_token_registry_redhat_io: THIS_IS_AN_EXAMPLE_TOKEN_FOR_REDHAT_IO
kubeinit_okd_openshift_registry_token_email: [email protected]

################################################
# Otherwise we will use the following defaults #
################################################

kubeinit_okd_registry: quay.io
kubeinit_okd_registry_organization_aux: '{% if ( kubeinit_okd_openshift_deploy | default(False)
  ) %} openshift-release-dev {% else %} openshift {% endif %}'
kubeinit_okd_registry_organization: "{{ kubeinit_okd_registry_organization_aux | replace('\
  \ ','') }}"

kubeinit_okd_registry_repository_aux: '{% if ( kubeinit_okd_openshift_deploy | default(False)
  ) %} ocp-release {% else %} okd {% endif %}'
kubeinit_okd_registry_repository: "{{ kubeinit_okd_registry_repository_aux | replace('\
  \ ','') }}"

###########################################################################
# Replace 4.7.18 with the OpenShift release you will like to deploy, or   #
# 4.7.0-0.okd-2021-06-19-191547 with the choosen OKD release.             #
###########################################################################
kubeinit_okd_registry_release_tag_aux: '{% if ( kubeinit_okd_openshift_deploy | default(False)
  ) %} 4.7.18 {% else %} 4.7.0-0.okd-2021-06-19-191547 {% endif %}'
kubeinit_okd_registry_release_tag: "{{ kubeinit_okd_registry_release_tag_aux | replace('\
  \ ','') }}"

kubeinit_okd_registry_release_tag_major: "{{ kubeinit_okd_registry_release_tag.split('.')[0]\
  \ }}"
kubeinit_okd_registry_release_tag_minor: "{{ kubeinit_okd_registry_release_tag.split('.')[1]\
  \ }}"
kubeinit_okd_registry_release_tag_rev: "{{ kubeinit_okd_registry_release_tag.split('.')[2]\
  \ }}"

kubeinit_okd_registry_release_url_aux: '{% if ( kubeinit_okd_openshift_deploy | default(False)
  ) %} https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ kubeinit_okd_registry_release_tag
  }}/release.txt {% else %} https://api.github.com/repos/openshift/okd/releases/tags/{{
  kubeinit_okd_registry_release_tag }} {% endif %}'
kubeinit_okd_registry_release_url: "{{ kubeinit_okd_registry_release_url_aux | replace('\
  \ ','') }}"

# The space after the first single quote is required, do not remove
# Something in Ansible appears to be recognizing this as valid Python,
# so it's getting transformed into a Python list and then serialized
# using Python's str(), which is why we end up with the single-quoted values.
kubeinit_okd_registry_pullsecret: '  { "auths": {} }'
kubeinit_okd_registry_pullsecret_empty: '  { "auths": {} }'

kubeinit_okd_dependencies_client_aux: '{% if ( kubeinit_okd_openshift_deploy | default(False)
  ) %} https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ kubeinit_okd_registry_release_tag
  }}/openshift-client-linux-{{ kubeinit_okd_registry_release_tag }}.tar.gz {% else
  %} https://github.com/openshift/okd/releases/download/{{ kubeinit_okd_registry_release_tag
  }}/openshift-client-linux-{{ kubeinit_okd_registry_release_tag }}.tar.gz {% endif
  %}'

kubeinit_okd_dependencies_installer_aux: '{% if ( kubeinit_okd_openshift_deploy |
  default(False) ) %} https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{
  kubeinit_okd_registry_release_tag }}/openshift-install-linux-{{ kubeinit_okd_registry_release_tag
  }}.tar.gz {% else %} https://github.com/openshift/okd/releases/download/{{ kubeinit_okd_registry_release_tag
  }}/openshift-install-linux-{{ kubeinit_okd_registry_release_tag }}.tar.gz {% endif
  %}'

kubeinit_okd_dependencies:
  client: "{{ kubeinit_okd_dependencies_client_aux | replace(' ','') }}"
  installer: "{{ kubeinit_okd_dependencies_installer_aux | replace(' ','') }}"

kubeinit_okd_service_dependencies:
- haproxy
- httpd
- bind
- bind-utils
- nfs-utils
- wget
- git
- jq
- socat
- gcc
- make
- patch
- libgomp
- glibc-headers
- glibc-devel
- kernel-headers
- kernel-devel
- nano
- libvirt-devel
- podman
- podman-docker

Molecule Scenarios

Molecule is being used to test the “kubeinit_okd” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.

Scenario: default

Driver: docker
Example default playbook
- name: Converge
  hosts: all
  # roles:
  #   - role: "kubeinit_okd"
  tasks:
  - name: Message for "kubeinit_okd"
    ansible.builtin.debug:
      msg: Finishing molecule for "kubeinit_okd"