1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- ---
- - name: Install openshift support packages
- package:
- name: "{{ openshift_node_support_packages | join(',') }}"
- state: latest
- update_cache: true
- async: 3600
- poll: 30
- register: result
- until: result is succeeded
- - name: Get cluster version
- command: >
- oc get clusterversion
- --kubeconfig={{ openshift_node_kubeconfig_path }}
- --output=jsonpath='{.items[0].status.desired.version}'
- delegate_to: localhost
- register: oc_get
- until:
- - oc_get.stdout != ''
- - name: Set fact l_cluster_version
- set_fact:
- l_cluster_version: "{{ oc_get.stdout | regex_search('^\\d+\\.\\d+') }}"
- - name: Override cluster version when running CI
- set_fact:
- l_cluster_version: "*"
- when: ci_version_override | default(false) | bool == true
- - name: Get kubernetes server version
- command: >
- oc version
- --kubeconfig={{ openshift_node_kubeconfig_path }}
- --output=json
- delegate_to: localhost
- register: oc_get
- until:
- - oc_get.stdout != ''
- - name: Set fact l_kubernetes_version
- set_fact:
- l_kubernetes_version: "{{ (oc_get.stdout | from_json).serverVersion.major ~ '.' ~ (oc_get.stdout | from_json).serverVersion.minor | regex_search('^\\d+') }}"
- - name: Override kubernetes version when running CI
- set_fact:
- l_kubernetes_version: "*"
- when: ci_version_override | default(false) | bool == true
- - block:
- - name: Install openshift packages
- package:
- name: "{{ openshift_node_packages | join(',') }}"
- state: latest
- async: 3600
- poll: 30
- register: result
- until: result is succeeded
- rescue:
- - name: Package install failure message
- fail:
- msg: >
- Unable to install {{ openshift_node_packages | join(', ') }}.
- Please ensure repos are configured properly to provide these packages
- and indicated versions.
- - name: Enable the CRI-O service
- systemd:
- name: "crio"
- enabled: yes
- # persistent storage in journal is needed for MachineConfig to work
- - name: Enable persistent storage on journal
- ini_file:
- dest: "/etc/systemd/journald.conf"
- section: Journal
- option: Storage
- value: "persistent"
- no_extra_spaces: yes
|