main.yml 1.1 KB

123456789101112131415161718192021222324252627
  1. ---
  2. - openshift_facts:
  3. - role: common
  4. local_facts:
  5. deployment_type: "{{ openshift_deployment_type }}"
  6. docker_additional_registries: "{{ docker_additional_registries | oo_split() }}"
  7. docker_insecure_registries: "{{ docker_insecure_registries | oo_split() }}"
  8. docker_blocked_registries: "{{ docker_blocked_registries | oo_split() }}"
  9. - name: Set registry params
  10. lineinfile:
  11. dest: /etc/sysconfig/docker
  12. regexp: '^{{ reg_conf_var }}=.*$'
  13. line: "{{ reg_conf_var }}='{{ reg_fact_val | oo_prepend_strings_in_list(reg_flag ~ ' ') | join(' ') }}'"
  14. when: "'docker_additional_registries' in openshift.common"
  15. with_items:
  16. - reg_conf_var: ADD_REGISTRY
  17. reg_fact_val: {{ openshift.common.docker_additional_registries }}
  18. reg_flag: --add-registry
  19. - reg_conf_var: BLOCK_REGISTRY
  20. reg_fact_val: {{ openshift.common.docker_blocked_registries }}
  21. reg_flag: --block-registry
  22. - reg_conf_var: INSECURE_REGISTRY
  23. reg_fact_val: {{ openshift.common.docker_insecure_registries }}
  24. reg_flag: --insecure-registry
  25. notify:
  26. - restart docker