12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- ---
- # Variables affecting this role:
- #
- # tools:
- # - final_name: the path to the tool to check for
- # completion: look for bash_completion or no
- # completion_file: the name of the bash completion file
- # clusters:
- # just a simple list of clusters to check
- #
- - name: Check for tools
- file:
- path: "{{ tools[item].final_name }}"
- state: file
- loop: "{{ tools.keys() | list }}"
- - name: Check for completion files
- file:
- path: /etc/bash_completion.d/{{ tools[item].completion_file }}
- state: file
- when: tools[item].completion
- loop: "{{ tools.keys() | list }}"
- - name: Make sure kubeconfig is there on utility
- delegate_to: utility.lab.example.com
- file:
- path: /home/lab/{{ item }}/auth/kubeconfig
- state: file
- loop: "{{ clusters }}"
- - name: Create a temp dir
- file:
- path: tmp
- state: directory
- - name: Copy over the kubeconfig
- delegate_to: utility.lab.example.com
- fetch:
- src: /home/lab/{{ item }}/auth/kubeconfig
- dest: tmp/kubeconfig-{{ item }}
- flat: yes
- loop: "{{ clusters }}"
- - name: "We need python-kubernetes >= 12"
- become: yes
- pip:
- name: kubernetes>=12.0.0
- # XXX This won't do if you install it using pip.
- - name: We also need python38-jmespath
- become: yes
- package:
- name: python38-jmespath
- state: latest
- - name: Verify cluster connectivity
- kubernetes.core.k8s_cluster_info:
- kubeconfig: tmp/kubeconfig-{{ item }}
- validate_certs: no
- loop: "{{ clusters }}"
- - name: Check RHSSO ZIP is there
- stat:
- path: "{{ ansible_facts['user_dir'] }}/Downloads/rh-sso-{{ sso_z }}-server-dist.zip"
- register: sso_zip
- when: need_sso_zip
- - assert:
- that: sso_zip.stat.exists
- fail_msg: "ERROR: RHSSO ZIP not downloaded! Please go to section 'Before You Begin' in your book."
- success_msg: "OK: Found RHSSO ZIP file."
- when: need_sso_zip
- ...
|