Configurable docker yum repos, systemd fix
* Make yum repos used for installing docker rpms configurable * TasksMax is only supported in systemd version >= 226 * Change to systemd file should restart docker
This commit is contained in:
parent
383d582b47
commit
5efda3eda9
4 changed files with 13 additions and 2 deletions
|
@ -10,3 +10,6 @@ docker_repo_info:
|
||||||
repos:
|
repos:
|
||||||
|
|
||||||
docker_dns_servers_strict: yes
|
docker_dns_servers_strict: yes
|
||||||
|
|
||||||
|
docker_rh_repo_base_url: 'https://yum.dockerproject.org/repo/main/centos/7'
|
||||||
|
docker_rh_repo_gpgkey: 'https://yum.dockerproject.org/gpg'
|
||||||
|
|
|
@ -10,11 +10,17 @@
|
||||||
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
|
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
|
||||||
when: http_proxy is defined or https_proxy is defined or no_proxy is defined
|
when: http_proxy is defined or https_proxy is defined or no_proxy is defined
|
||||||
|
|
||||||
|
- name: get systemd version
|
||||||
|
command: rpm -q --qf '%{V}\n' systemd
|
||||||
|
register: systemd_version
|
||||||
|
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or is_atomic)
|
||||||
|
|
||||||
- name: Write docker.service systemd file
|
- name: Write docker.service systemd file
|
||||||
template:
|
template:
|
||||||
src: docker.service.j2
|
src: docker.service.j2
|
||||||
dest: /etc/systemd/system/docker.service
|
dest: /etc/systemd/system/docker.service
|
||||||
register: docker_service_file
|
register: docker_service_file
|
||||||
|
notify: restart docker
|
||||||
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or is_atomic)
|
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or is_atomic)
|
||||||
|
|
||||||
- name: Write docker.service systemd file for atomic
|
- name: Write docker.service systemd file for atomic
|
||||||
|
|
|
@ -24,7 +24,9 @@ ExecStart={{ docker_bin_dir }}/docker daemon \
|
||||||
$DOCKER_NETWORK_OPTIONS \
|
$DOCKER_NETWORK_OPTIONS \
|
||||||
$DOCKER_DNS_OPTIONS \
|
$DOCKER_DNS_OPTIONS \
|
||||||
$INSECURE_REGISTRY
|
$INSECURE_REGISTRY
|
||||||
|
{% if systemd_version.stdout|int >= 226 %}
|
||||||
TasksMax=infinity
|
TasksMax=infinity
|
||||||
|
{% endif %}
|
||||||
LimitNOFILE=1048576
|
LimitNOFILE=1048576
|
||||||
LimitNPROC=1048576
|
LimitNPROC=1048576
|
||||||
LimitCORE=infinity
|
LimitCORE=infinity
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[dockerrepo]
|
[dockerrepo]
|
||||||
name=Docker Repository
|
name=Docker Repository
|
||||||
baseurl=https://yum.dockerproject.org/repo/main/centos/7
|
baseurl={{ docker_rh_repo_base_url }}
|
||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=1
|
gpgcheck=1
|
||||||
gpgkey=https://yum.dockerproject.org/gpg
|
gpgkey={{ docker_rh_repo_gpgkey }}
|
||||||
{% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %}
|
{% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue