| --- |
| - name: Download bootstrap with proxy |
| become: yes |
| bootstrap: |
| dest_dir: '{{ opdk_installer_path }}' |
| version: '{{ opdk_version }}' |
| url: '{{ apigee_repo_url | default(default_apigee_repo_url) }}' |
| user_name: '{{ apigee_repo_user | default(default_apigee_repo_user) }}' |
| password: '{{ apigee_repo_password | default(default_apigee_repo_password) }}' |
| register: results |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| |
| - 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: install-bootstrap.yml |
| |
| rescue: |
| - name: Yum failed to update, let's clean yum |
| command: 'yum clean all' |
| |
| - include_tasks: install-bootstrap.yml |
| become: yes |