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_run_once: False
download_compress: 1 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 # 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 # (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. # local caching of docker images or for Container Linux by CoreOS cluster nodes.

View file

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

View file

@ -11,7 +11,7 @@
when: when:
- not skip_downloads|default(false) - not skip_downloads|default(false)
- item.value.enabled - 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" - name: "Sync container"
include_tasks: sync_container.yml include_tasks: sync_container.yml

View file

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

View file

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