Add download_container flag to avoid docker pull when use cri-o.

This commit is contained in:
Takashi Okamoto 2018-08-04 10:01:35 +00:00
parent cf7b9cfeef
commit 5ab8a712d9
5 changed files with 11 additions and 3 deletions

View file

@ -10,6 +10,9 @@ skip_downloads: false
download_run_once: False
download_compress: 1
# if this is set to true will download container
download_container: True
# if this is set to true, uses the localhost for download_run_once mode
# (requires docker and sudo to access docker). You may want this option for
# local caching of docker images or for Container Linux by CoreOS cluster nodes.

View file

@ -7,6 +7,7 @@
failed_when: false
changed_when: false
check_mode: no
when: download_container
- name: container_download | Create dest directory for saved/loaded container images
file:
@ -15,6 +16,7 @@
recurse: yes
mode: 0755
owner: "{{ansible_ssh_user|default(ansible_user_id)}}"
when: download_container
- name: container_download | create local directory for saved/loaded container images
file:
@ -28,5 +30,6 @@
when:
- download_run_once
- download_delegate == 'localhost'
- download_container
tags:
- localhost

View file

@ -11,7 +11,7 @@
when:
- not skip_downloads|default(false)
- item.value.enabled
- not item.value.container | item.value.container and download_container
- (not (item.value.container|default(False))) or (item.value.container and download_container)
- name: "Sync container"
include_tasks: sync_container.yml

View file

@ -3,7 +3,6 @@
- name: install | Copy kubelet binary from download dir
command: rsync -piu "{{ local_release_dir }}/hyperkube" "{{ bin_dir }}/kubelet"
changed_when: false
when: hyperkube_enabled
tags:
- hyperkube
- upgrade
@ -13,7 +12,6 @@
path: "{{ bin_dir }}/kubelet"
mode: "0755"
state: file
when: hyperkube_enabled
tags:
- hyperkube
- upgrade

View file

@ -135,6 +135,10 @@ kube_api_aggregator_routing: false
# Optionally do not run docker role
manage_docker: true
# cri-o options
# Optionally run cri-o role
manage_crio: false
# Path used to store Docker data
docker_daemon_graph: "/var/lib/docker"