| --- |
| - name: Create installer path |
| file: |
| path: "{{ opdk_installer_path }}" |
| owner: "{{ opdk_user_name }}" |
| group: "{{ opdk_group_name }}" |
| |
| - name: Download bootstrap with no proxy |
| include_tasks: online/download-bootstrap-with-no-proxy.yml |
| when: (https_proxy is not defined or https_proxy | trim == '') and (http_proxy is not defined or http_proxy | trim == '') |
| |
| - name: Download bootstrap with proxy |
| include_tasks: online/download-bootstrap-with-proxy.yml |
| when: https_proxy is defined and https_proxy | trim != '' and http_proxy is defined and http_proxy | trim != '' |
| |
| - name: Bootstrap script exists |
| stat: |
| path: '{{ bootstrap_script }}' |
| register: bootstrap_exists |
| |
| - name: Cache bootstrap script state |
| cache: |
| key: bootstrap_script_exists |
| value: '{{ bootstrap_exists.stat.exists }}' |
| |
| - name: Fail the playbook if bootstrap fails to download |
| fail: |
| msg: 'Bootstrap installation failed, no point in letting this go further' |
| when: not bootstrap_exists.stat.exists |
| |
| - name: Yum clean all |
| become: yes |
| shell: "yum clean all" |
| |
| - block: |
| - include_tasks: online/install-bootstrap-with-no-proxy.yml |
| when: (https_proxy is not defined or https_proxy | trim == '') and (http_proxy is not defined or http_proxy | trim == '') |
| |
| - include_tasks: online/install-bootstrap-with-proxy.yml |
| when: https_proxy is defined and https_proxy | trim != '' and http_proxy is defined and http_proxy | trim != '' |
| |
| rescue: |
| - name: Yum failed to update, let's clean yum |
| shell: 'yum clean all' |
| |
| - include_tasks: online/install-bootstrap-with-no-proxy.yml |
| when: (https_proxy is not defined or https_proxy | trim == '') and (http_proxy is not defined or http_proxy | trim == '') |
| |
| - include_tasks: online/install-bootstrap-with-proxy.yml |
| when: https_proxy is defined and https_proxy | trim != '' and http_proxy is defined and http_proxy | trim != '' |
| become: yes |