Wolfgang Kulhanek
2020-01-21 58bf1407eaff380db2689aef697e073a58d9d05c
Installer role updates
3 files modified
1 files renamed
69 ■■■■ changed files
ansible/roles/host-ocp4-installer/tasks/generate_install_config.yml 8 ●●●●● patch | view | raw | blame | history
ansible/roles/host-ocp4-installer/tasks/install_installer.yml 1 ●●●● patch | view | raw | blame | history
ansible/roles/host-ocp4-installer/tasks/main.yml 7 ●●●●● patch | view | raw | blame | history
ansible/roles/host-ocp4-installer/tasks/print_cluster_info.yml 53 ●●●● patch | view | raw | blame | history
ansible/roles/host-ocp4-installer/tasks/generate_install_config.yml
File was renamed from ansible/roles/host-ocp4-installer/tasks/generate.ocp.configs.yml
@@ -1,4 +1,3 @@
- name: Generate SSH keys
  shell: ssh-keygen -b 2048 -t rsa -f /home/{{ ansible_user }}/.ssh/id_rsa -q -N ""
  args:
@@ -18,6 +17,7 @@
  file:
    path: /home/{{ ansible_user }}/{{ cluster_name }}
    state: directory
- name: Check if version specific install-config.j2 exists
  stat:
    path: templates/install-config.yaml.{{ ocp4_installer_version }}.j2
@@ -34,12 +34,14 @@
  set_fact:
    install_config_template_path: templates/install-config.yaml.j2
  when: not rconfig.stat.exists
- debug:
    var: ocp4_base_domain
# - debug:
#     var: ocp4_base_domain
- name: Generate config install-config.yaml
  template:
    src: "{{ install_config_template_path }}"
    dest: /home/{{ ansible_user }}/{{ cluster_name }}/install-config.yaml
- name: Make a copy of the cluster install config
  copy:
    remote_src: true
ansible/roles/host-ocp4-installer/tasks/install_installer.yml
@@ -1,5 +1,4 @@
- name: Set URLs for OpenShift GA releases
  when: not ocp4_installer_use_dev_preview | d(False) | bool
  set_fact:
    ocp4_installer_url: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ ocp4_installer_version }}/openshift-install-linux-{{ ocp4_installer_version }}.tar.gz"
    ocp4_client_url: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ ocp4_installer_version }}/openshift-client-linux-{{ ocp4_installer_version }}.tar.gz"
ansible/roles/host-ocp4-installer/tasks/main.yml
@@ -1,9 +1,8 @@
- name: Install client and OpenShift Installer binaries
  import_tasks: install_installer.yml
- name: Install client and OpenShift Installer binaries
  import_tasks: generate.ocp.configs.yml
- name: Generate install_config.yaml
  import_tasks: generate_install_config.yml
- name: Create deployinprogress file
  file:
@@ -24,6 +23,7 @@
  loop:
    - kubeconfig
    - kubeadmin-password
- name: Make sure .kube directory exists in home directory
  file:
    state: directory
@@ -54,7 +54,6 @@
- name: Gather and Print cluster info
  import_tasks: print_cluster_info.yml
- name: Delete deployinprogress lock file
  file:
ansible/roles/host-ocp4-installer/tasks/print_cluster_info.yml
@@ -1,4 +1,3 @@
- name: Get kubeadmin password
  slurp:
    path: /home/{{ ansible_user }}/{{ cluster_name }}/auth/kubeadmin-password
@@ -14,58 +13,22 @@
  until: routeconsole is succeeded
  ignore_errors: yes
# Adjust for clusters with just one worker. Default is two routers with antiAffinity rules.
# Which means that one router is pending. This doesn't work with Certificates
- name: Set number of Ingress Controller replicas to 1 if only one worker node deployed
  when: worker_instance_count == 1
- name: Get Webconsole URL
  environment:
    KUBECONFIG: /home/{{ ansible_user }}/{{ cluster_name }}/auth/kubeconfig
  shell: "oc patch ingresscontroller default --type=merge --patch='{\"spec\": { \"replicas\": 1 }}' -n openshift-ingress-operator"
  ignore_errors: yes
  command: oc whoami --show-console
  register: webconsole_url
- name: Set webconsole address
  set_fact:
    webconsole: "http://{{ routeconsole.stdout | from_json | json_query('spec.host') }}"
  when: routeconsole is succeeded
# sometimes the route is not ready, guess it
- name: Guess webconsole address
  set_fact:
    webconsole: "http://console-openshift-console.apps.{{ cluster_name }}.{{ guid }}.{{ subdomain_base }}"
  when: routeconsole is failed
- name: Get API for command line
- name: Get API URL
  environment:
    KUBECONFIG: /home/{{ ansible_user }}/{{ cluster_name }}/auth/kubeconfig
  command: oc whoami --show-server
  register: showserver
  register: api_url
- name: Print Overview
- name: Print Connection Information
  debug:
    msg: "{{ item }}"
  with_items:
    - "user.info: Openshift Master Console: {{ webconsole }}"
    - "user.info: Openshift API for command line 'oc' client: {{ showserver.stdout | trim }}"
    - "user.info: Openshift Master Console: {{ webconsole_url.stdout | trim }}"
    - "user.info: Openshift API for command line 'oc' client: {{ api_url.stdout | trim }}"
    - "user.info: Download oc client from {{ ocp4_client_url }}"
- name: Output htpasswd
  debug:
    msg: "user.info: This cluster has authentication enabled. You can use '{{ admin_user }}' with password '{{ admin_password }}' to access your cluster"
  when:
    - admin_password is defined
    - install_idm == "htpasswd"
- name: Output kubeadmin
  debug:
    msg: "user.info: Kubeadmin user / password: kubeadmin / {{ kubeadminr.content | b64decode }}"
  when: >-
    install_idm is not defined
    or install_idm != "htpasswd"
- name: Print SSH warning
  debug:
    msg: "{{ item }}"
  with_items:
    - "user.info: "
    - "user.info: You *CANNOT* SSH into this environment"
  when: not install_student_user | bool