| | |
| | | environment: |
| | | KUBECONFIG: /home/{{ ansible_user }}/{{ cluster_name }}/auth/kubeconfig |
| | | command: oc whoami --show-server |
| | | register: showserver |
| | | register: r_showserver |
| | | |
| | | - name: Print Overview |
| | | debug: |
| | | - name: Openshift access user info messages |
| | | agnosticd_user_info: |
| | | msg: "{{ item }}" |
| | | with_items: |
| | | - "user.info: Openshift Master Console: {{ webconsole }}" |
| | | - "user.info: Openshift API for command line 'oc' client: {{ showserver.stdout | trim }}" |
| | | - "user.info: Download oc client from https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ ocp4_installer_version }}/openshift-client-linux-{{ ocp4_installer_version }}.tar.gz" |
| | | loop: |
| | | - "Openshift Master Console: {{ webconsole }}" |
| | | - "Openshift API for command line 'oc' client: {{ r_showserver.stdout | trim }}" |
| | | - "Download oc client from https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ ocp4_installer_version }}/openshift-client-linux-{{ ocp4_installer_version }}.tar.gz" |
| | | |
| | | - name: Openshift access user data |
| | | agnosticd_user_info: |
| | | data: |
| | | openshift_console_url: "{{ webconsole }}" |
| | | openshift_api_url: "{{ r_showserver.stdout | trim }}" |
| | | openshift_client_download_url: "{{ 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" |
| | | agnosticd_user_info: |
| | | msg: "This cluster has authentication enabled. You can use '{{ admin_user }}' with password '{{ admin_password }}' to access your cluster" |
| | | data: |
| | | openshift_admin_user: "{{ admin_user }}" |
| | | openshift_admin_password: "{{ admin_password }}" |
| | | when: |
| | | - admin_password is defined |
| | | - install_idm == "htpasswd" |
| | | |
| | | - name: Output kubeadmin |
| | | debug: |
| | | msg: "user.info: Kubeadmin user / password: kubeadmin / {{ kubeadminr.content | b64decode }}" |
| | | agnosticd_user_info: |
| | | msg: "Kubeadmin user / password: kubeadmin / {{ kubeadminr.content | b64decode }}" |
| | | data: |
| | | openshift_kubeadmin_password: "{{ kubeadminr.content | b64decode }}" |
| | | when: >- |
| | | install_idm is not defined |
| | | or install_idm != "htpasswd" |
| | | |
| | | - name: Print SSH warning |
| | | debug: |
| | | agnosticd_user_info: |
| | | msg: "{{ item }}" |
| | | with_items: |
| | | - "user.info: " |
| | | - "user.info: You *CANNOT* SSH into this environment" |
| | | loop: |
| | | - "" |
| | | - "You *CANNOT* SSH into this environment" |
| | | when: not install_student_user | bool |
| | | |
| | | always: |
| | |
| | | become: false |
| | | tasks: |
| | | # NOT Pre-installed |
| | | - name: Print Student aws access as user.info |
| | | debug: |
| | | msg: "{{ item }}" |
| | | with_items: |
| | | - "user.info: Top level domain: {{ subdomain_base_suffix }}" |
| | | - "user.info: " |
| | | - "user.info: WARNING: with great power comes great responsibility. We monitor usage." |
| | | - "user.info: Your AWS programmatic access:" |
| | | - "user.info: aws_access_key_id = {{ student_access_key_id }}" |
| | | - "user.info: aws_secret_access_key = {{ student_secret_access_key }}" |
| | | when: |
| | | - when: |
| | | - not install_ocp4 | bool |
| | | - student_access_key_id is defined |
| | | - student_secret_access_key is defined |
| | | block: |
| | | - name: Print Student aws access as user.info |
| | | agnosticd_user_info: |
| | | msg: "{{ item }}" |
| | | loop: |
| | | - "Top level domain: {{ subdomain_base_suffix }}" |
| | | - "" |
| | | - "WARNING: with great power comes great responsibility. We monitor usage." |
| | | - "Your AWS programmatic access:" |
| | | - "aws_access_key_id = {{ student_access_key_id }}" |
| | | - "aws_secret_access_key = {{ student_secret_access_key }}" |
| | | |
| | | - name: Print Student SSH access as user.info |
| | | debug: |
| | | msg: "{{ item }}" |
| | | with_items: |
| | | - "user.info: " |
| | | - "user.info: SSH Access: ssh {{ student_name }}@bastion.{{ guid }}{{ subdomain_base_suffix }}" |
| | | - "user.info: SSH password: {{ student_password | d(hostvars[groups.bastions.0].student_password) }}" |
| | | when: |
| | | - name: Set aws access user data |
| | | agnosticd_user_info: |
| | | data: |
| | | subdomain_base_suffix: "{{ subdomain_base_suffix }}" |
| | | aws_access_key_id: "{{ student_access_key_id }}" |
| | | aws_secret_access_key: "{{ student_secret_access_key }}" |
| | | |
| | | - when: |
| | | - install_student_user | bool |
| | | - student_name is defined |
| | | - student_password is defined or hostvars[groups.bastions.0].student_password is defined |
| | | block: |
| | | - name: Print Student SSH access as user.info |
| | | agnosticd_user_info: |
| | | msg: "{{ item }}" |
| | | loop: |
| | | - "" |
| | | - "SSH Access: ssh {{ student_name }}@bastion.{{ guid }}{{ subdomain_base_suffix }}" |
| | | - "SSH password: {{ student_password | default(hostvars[groups.bastions.0].student_password) }}" |
| | | when: |
| | | - install_student_user | bool |
| | | - student_name is defined |
| | | - student_password is defined or hostvars[groups.bastions.0].student_password is defined |
| | | |
| | | - name: User access data |
| | | agnosticd_user_info: |
| | | data: |
| | | student_ssh_command: "ssh {{ student_name }}@bastion.{{ guid }}{{ subdomain_base_suffix }}" |
| | | student_ssh_password: "{{ student_password | default(hostvars[groups.bastions.0].student_password) }}" |