From 12c6b5c3ebb1a80fa7af12f1f47ccd3e2a1636cd Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 9 Apr 2019 08:17:05 +0100 Subject: [PATCH] openSUSE: Use Leap 15.0 instead of 42.3 (#4442) * Vagrantfile: Bump openSUSE to Leap 15.0 * roles: container-engine: Add 'containerd' package for openSUSE The 'containerd' package contains the docker-containerd and docker-containerd-shim binaries. We also need to ensure that the latest version is installed since an older version may already be present (eg GCE images) * Remove docker log-opts for opensuse * roles: bootstrap-os: Use lowercase 'o' for openSUSE OpenSUSE is not a valid family name. The correct one is openSUSE * roles: bootstrap-os: Update zypper cache before first installation The zypper cache may be outdated so ensure that it's fully updated before we try and install the bootstrap packages. --- Vagrantfile | 2 +- docs/opensuse.md | 2 +- inventory/sample/group_vars/all/docker.yml | 4 ++-- roles/bootstrap-os/tasks/bootstrap-opensuse.yml | 5 +++++ roles/bootstrap-os/tasks/main.yml | 2 +- roles/container-engine/docker/tasks/main.yml | 4 ++-- roles/container-engine/docker/vars/suse.yml | 2 ++ roles/kubespray-defaults/defaults/main.yaml | 4 ++-- 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 8ecaf246d..892089194 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -23,7 +23,7 @@ SUPPORTED_OS = { "centos" => {box: "centos/7", user: "vagrant"}, "centos-bento" => {box: "bento/centos-7.5", user: "vagrant"}, "fedora" => {box: "fedora/28-cloud-base", user: "vagrant"}, - "opensuse" => {box: "opensuse/openSUSE-42.3-x86_64", user: "vagrant"}, + "opensuse" => {box: "opensuse/openSUSE-15.0-x86_64", user: "vagrant"}, "opensuse-tumbleweed" => {box: "opensuse/openSUSE-Tumbleweed-x86_64", user: "vagrant"}, } diff --git a/docs/opensuse.md b/docs/opensuse.md index 88fac3790..6c76fd300 100644 --- a/docs/opensuse.md +++ b/docs/opensuse.md @@ -1,4 +1,4 @@ -openSUSE Leap 42.3 and Tumbleweed +openSUSE Leap 15.0 and Tumbleweed =============== openSUSE Leap installation Notes: diff --git a/inventory/sample/group_vars/all/docker.yml b/inventory/sample/group_vars/all/docker.yml index f81e6b08d..4e2a5594f 100644 --- a/inventory/sample/group_vars/all/docker.yml +++ b/inventory/sample/group_vars/all/docker.yml @@ -59,9 +59,9 @@ docker_options: >- {{ docker_registry_mirrors | map('regex_replace', '^(.*)$', '--registry-mirror=\1' ) | list | join(' ') }} {%- endif %} {%- if docker_version != "latest" and docker_version is version('17.05', '<') %} - --graph={{ docker_daemon_graph }} {{ docker_log_opts }} + --graph={{ docker_daemon_graph }} {% if ansible_os_family not in ["openSUSE Leap", "openSUSE Tumbleweed", "Suse"] %}{{ docker_log_opts }}{% endif %} {%- else %} - --data-root={{ docker_daemon_graph }} {{ docker_log_opts }} + --data-root={{ docker_daemon_graph }} {% if ansible_os_family not in ["openSUSE Leap", "openSUSE Tumbleweed", "Suse"] %}{{ docker_log_opts }}{% endif %} {%- endif %} {%- if ansible_architecture == "aarch64" and ansible_os_family == "RedHat" %} --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current diff --git a/roles/bootstrap-os/tasks/bootstrap-opensuse.yml b/roles/bootstrap-os/tasks/bootstrap-opensuse.yml index b081710a1..4eeae9fa9 100644 --- a/roles/bootstrap-os/tasks/bootstrap-opensuse.yml +++ b/roles/bootstrap-os/tasks/bootstrap-opensuse.yml @@ -1,4 +1,9 @@ --- +- name: Ensure zypper cache is updated (SUSE) + zypper_repository: + repo: "*" + runrefresh: yes + - name: Install required packages (SUSE) package: name: "{{ item }}" diff --git a/roles/bootstrap-os/tasks/main.yml b/roles/bootstrap-os/tasks/main.yml index a1a3bb946..5733c7db4 100644 --- a/roles/bootstrap-os/tasks/main.yml +++ b/roles/bootstrap-os/tasks/main.yml @@ -23,7 +23,7 @@ when: '"CentOS" in os_release.stdout or "Red Hat Enterprise Linux" in os_release.stdout' - include_tasks: bootstrap-opensuse.yml - when: '"OpenSUSE" in os_release.stdout' + when: '"openSUSE" in os_release.stdout' - include_tasks: bootstrap-clearlinux.yml when: '"Clear Linux OS" in os_release.stdout' diff --git a/roles/container-engine/docker/tasks/main.yml b/roles/container-engine/docker/tasks/main.yml index 516f4b39b..c9f677567 100644 --- a/roles/container-engine/docker/tasks/main.yml +++ b/roles/container-engine/docker/tasks/main.yml @@ -151,7 +151,7 @@ pkg: "{{item.name}}" force: "{{item.force|default(omit)}}" conf_file: "{{item.yum_conf|default(omit)}}" - state: present + state: "{{item.state | default('present')}}" update_cache: "{{ omit if ansible_distribution == 'Fedora' else True }}" register: docker_task_result until: docker_task_result is succeeded @@ -166,7 +166,7 @@ action: "{{ docker_package_info.pkg_mgr }}" args: name: "{{ item.name }}" - state: present + state: "{{item.state | default('present')}}" with_items: "{{ docker_package_info.pkgs }}" register: docker_task_result until: docker_task_result is succeeded diff --git a/roles/container-engine/docker/vars/suse.yml b/roles/container-engine/docker/vars/suse.yml index d89a50a7f..0353286ca 100644 --- a/roles/container-engine/docker/vars/suse.yml +++ b/roles/container-engine/docker/vars/suse.yml @@ -5,6 +5,8 @@ docker_package_info: pkg_mgr: zypper pkgs: - name: docker + - name: containerd + state: latest docker_repo_key_info: pkg_key: '' diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 532220288..c6407cb32 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -236,9 +236,9 @@ docker_options: >- {{ docker_registry_mirrors | map('regex_replace', '^(.*)$', '--registry-mirror=\1' ) | list | join(' ') }} {%- endif %} {%- if docker_version != "latest" and docker_version is version('17.05', '<') %} - --graph={{ docker_daemon_graph }} {{ docker_log_opts }} + --graph={{ docker_daemon_graph }} {% if ansible_os_family not in ["openSUSE Leap", "openSUSE Tumbleweed", "Suse"] %}{{ docker_log_opts }}{% endif %} {%- else %} - --data-root={{ docker_daemon_graph }} {{ docker_log_opts }} + --data-root={{ docker_daemon_graph }} {% if ansible_os_family not in ["openSUSE Leap", "openSUSE Tumbleweed", "Suse"] %}{{ docker_log_opts }}{% endif %} {%- endif %} {%- if ansible_architecture == "aarch64" and ansible_os_family == "RedHat" %} --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current