Browse Source

clean up unwanted image streams and import the rhel image streams

master
Nicolas Massé 8 years ago
parent
commit
8bfcc4c15d
  1. 24
      playbooks/provision-global-templates-and-imagestreams.yml

24
playbooks/provision-global-templates-and-imagestreams.yml

@ -66,6 +66,30 @@
when: item|regex_search('-ephemeral$') when: item|regex_search('-ephemeral$')
with_items: '{{ oc_get_templates.stdout_lines }}' with_items: '{{ oc_get_templates.stdout_lines }}'
- name: Get a list of currently installed image streams
command: oc get is -n openshift -o name
register: oc_get_is
- name: Delete unwanted image streams
command: oc delete {{ item }} -n openshift
when: item|regex_search('(datagrid|datavirt|decisionserver|eap64|processserver|tomcat7)')
with_items: '{{ oc_get_is.stdout_lines }}'
- name: Get a list of the remaining image streams
command: oc get is -n openshift -o name
register: oc_get_is
- name: Update each image stream
command: oc import-image {{ item }} --confirm --scheduled --all -n openshift
with_items: '{{ oc_get_is.stdout_lines }}'
- name: Import additional Red Hat image streams
command: oc import-image -n openshift {{ item.key }} --from {{ item.value }} --confirm --scheduled --all
with_dict:
rhel-atomic: rhel-atomic
rhel: rhel7.4
when: '(''imagestreams/'' ~ item.key) not in oc_get_is.stdout_lines'
- name: Delete the temporary directory - name: Delete the temporary directory
file: file:
path: '{{ tempfile.path }}' path: '{{ tempfile.path }}'

Loading…
Cancel
Save