summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/tasks
diff options
context:
space:
mode:
authorWesley Hearn <wesley.s.hearn@gmail.com>2015-08-26 11:55:18 -0400
committerWesley Hearn <wesley.s.hearn@gmail.com>2015-08-26 11:55:18 -0400
commit2595194cc34db43de2d9f139ff7ed1cd41c47ab1 (patch)
treef3b00e968ef1375f5c2f99900b8db35a6e393507 /roles/openshift_node/tasks
parent16ee4457862a79f77b43997a646b4e27391c34fb (diff)
parentd17a583db7d1caef4a60a19f0379da8bce25754a (diff)
downloadopenshift-2595194cc34db43de2d9f139ff7ed1cd41c47ab1.tar.gz
openshift-2595194cc34db43de2d9f139ff7ed1cd41c47ab1.tar.bz2
openshift-2595194cc34db43de2d9f139ff7ed1cd41c47ab1.tar.xz
openshift-2595194cc34db43de2d9f139ff7ed1cd41c47ab1.zip
Merge pull request #509 from lhuard1A/configure_docker_registries
Add options to configure docker registries
Diffstat (limited to 'roles/openshift_node/tasks')
-rw-r--r--roles/openshift_node/tasks/main.yml42
1 files changed, 42 insertions, 0 deletions
diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml
index adffca252..18f0ce064 100644
--- a/roles/openshift_node/tasks/main.yml
+++ b/roles/openshift_node/tasks/main.yml
@@ -70,6 +70,48 @@
line: "OPTIONS='--insecure-registry={{ openshift.node.portal_net }} \
{% if ansible_selinux and ansible_selinux.status == '''enabled''' %}--selinux-enabled{% endif %}'"
when: docker_check.stat.isreg
+ notify:
+ - restart docker
+
+- set_fact:
+ docker_additional_registries: "registry.access.redhat.com,{{ lookup('oo_option', 'docker_additional_registries') }}"
+ when: deployment_type == 'enterprise'
+- set_fact:
+ docker_additional_registries: "{{ lookup('oo_option', 'docker_additional_registries') }}"
+ when: deployment_type != 'enterprise'
+
+- name: Add personal registries
+ lineinfile:
+ dest: /etc/sysconfig/docker
+ regexp: '^ADD_REGISTRY=.*'
+ line: "ADD_REGISTRY='{{ docker_additional_registries | oo_split()
+ | oo_prepend_strings_in_list('--add-registry ') | join(' ') }}'"
+ when: docker_check.stat.isreg and
+ docker_additional_registries != ''
+ notify:
+ - restart docker
+
+- name: Block registries
+ lineinfile:
+ dest: /etc/sysconfig/docker
+ regexp: '^BLOCK_REGISTRY=.*'
+ line: "BLOCK_REGISTRY='{{ lookup('oo_option', 'docker_blocked_registries') | oo_split()
+ | oo_prepend_strings_in_list('--block-registry ') | join(' ') }}'"
+ when: docker_check.stat.isreg and
+ lookup('oo_option', 'docker_blocked_registries') != ''
+ notify:
+ - restart docker
+
+- name: Grant access to additional insecure registries
+ lineinfile:
+ dest: /etc/sysconfig/docker
+ regexp: '^INSECURE_REGISTRY=.*'
+ line: "INSECURE_REGISTRY='{{ lookup('oo_option', 'docker_insecure_registries') | oo_split()
+ | oo_prepend_strings_in_list('--insecure-registry ') | join(' ') }}'"
+ when: docker_check.stat.isreg and
+ lookup('oo_option', 'docker_insecure_registries') != ''
+ notify:
+ - restart docker
- name: Allow NFS access for VMs
seboolean: name=virt_use_nfs state=yes persistent=yes