blob: 62e30b3ec250aa36b5f733a359052ed7140cea01 [file] [log] [blame]
---
- name: Update cache with key and value
cache:
key: "{{ item.key }}"
value: "{{ item.value }}"
with_items:
- { key: 'copy_archive', value: '{{ copy_archive }}' }
- name: Clear yum cache
become: yes
shell: yum clean all
- name: Clear yum disk cache
become: yes
file:
path: /var/cache/yum
state: absent
- name: Uninstall the local mirror
shell: /opt/apigee/apigee-service/bin/apigee-service apigee-mirror uninstall
environment:
no_proxy: "{{ no_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
args:
removes: "{{ apigee_home }}/apigee-mirror"
- name: Update apigeereleasevar variable for Yum to opdk_version
become: yes
copy:
content: "{{ opdk_version}}"
dest: /etc/yum/vars/apigeereleasever
mode: 600
owner: root
group: root
- name: Install the local mirror
shell: /opt/apigee/apigee-service/bin/apigee-service apigee-mirror install
environment:
no_proxy: "{{ no_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
creates: "{{ apigee_home }}/apigee-mirror"
- name: Update apigeereleasevar variable for Yum for apigee-mirror sync
become: yes
copy:
content: "{{ apigeereleasevar }}"
dest: /etc/yum/vars/apigeereleasever
mode: 600
owner: root
group: root
- name: Sync the local mirror with only new rpms
ignore_errors: yes
shell: "/opt/apigee/apigee-service/bin/apigee-service apigee-mirror sync --only-new-rpms apigeereleasever={{ apigeereleasever | default(opdk_version) }}"
environment:
no_proxy: "{{ no_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
when: all_rpms is not defined and not all_rpms | bool == True
- name: Sync the local mirror with all rpms
ignore_errors: yes
shell: "/opt/apigee/apigee-service/bin/apigee-service apigee-mirror sync apigeereleasever={{ apigeereleasever | default(opdk_version) }}"
environment:
no_proxy: "{{ no_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
when: all_rpms is defined and all_rpms | bool == True
- name: Update with any extra packages that should be transported manually
become: yes
shell: "yum reinstall --downloadonly --downloaddir={{ apigee_home }}/data/apigee-mirror/repos/thirdparty/7 {{ archive_extra_packages | join(' ') }}"
when: archive_extra_packages is defined
- name: Create archive
shell: "/opt/apigee/apigee-service/bin/apigee-service apigee-mirror package"
environment:
no_proxy: "{{ no_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
- name: Restore apigeereleasevar variable for Yum to opdk_version
become: yes
copy:
content: "{{ opdk_version}}"
dest: /etc/yum/vars/apigeereleasever
mode: 600
owner: root
group: root