From 7172bd5dc8b87924a5b652ef1e28e425629776ec Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 23 Feb 2018 21:20:10 +0100 Subject: [PATCH] Setup repositories for openSUSE Tumbleweed Tumbleweed as a rolling release model distribution does not have a sensible release version and is kept distinct from the classing "release + update" distributions that are called "Leap". Conditionalize the repository setup for tumbleweed properly, the base path is different and it does not have a releaseversion component (the release version is always changing, it is the snapshot date in the form YYYYMMDD). Change-Id: I700ba2279dc7aadc7051cad53898e1de9007a08d --- .../configure-mirrors/tasks/mirror/Suse.yaml | 23 ++++++++++++++++++- .../etc/zypp/repos.d/repo-oss.repo.j2 | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/roles/configure-mirrors/tasks/mirror/Suse.yaml b/roles/configure-mirrors/tasks/mirror/Suse.yaml index 7edef6c8a..d0b5f04c4 100644 --- a/roles/configure-mirrors/tasks/mirror/Suse.yaml +++ b/roles/configure-mirrors/tasks/mirror/Suse.yaml @@ -1,3 +1,13 @@ +- name: set zypper base package repository (openSUSE Leap) + set_fact: + opensuse_repo_baseurl: "{{ package_mirror }}/distribution/leap/$releasever/repo/oss/" + when: not ansible_distribution | search("Tumbleweed") + +- name: set zypper base package repository (openSUSE Tumbleweed) + set_fact: + opensuse_repo_baseurl: "{{ package_mirror }}/distribution/tumbleweed/repo/oss/" + when: ansible_distribution | search("Tumbleweed") + - name: Install Suse repository files become: yes template: @@ -8,6 +18,17 @@ src: "{{ item }}.j2" with_items: - etc/zypp/repos.d/repo-oss.repo - - etc/zypp/repos.d/repo-update.repo notify: - Update zypper cache + +- name: Install openSUSE Leap Update repository + become: yes + template: + dest: /etc/zypp/repos.d/repo-update.repo + group: root + mode: 0644 + owner: root + src: etc/zypp/repos.d/repo-update.repo.j2 + notify: + - Update zypper cache + when: not ansible_distribution | search("Tumbleweed") diff --git a/roles/configure-mirrors/templates/etc/zypp/repos.d/repo-oss.repo.j2 b/roles/configure-mirrors/templates/etc/zypp/repos.d/repo-oss.repo.j2 index f953b0a3f..d345196e4 100644 --- a/roles/configure-mirrors/templates/etc/zypp/repos.d/repo-oss.repo.j2 +++ b/roles/configure-mirrors/templates/etc/zypp/repos.d/repo-oss.repo.j2 @@ -3,6 +3,6 @@ name=repo-oss enabled=1 autorefresh=0 -baseurl={{ package_mirror }}/distribution/leap/$releasever/repo/oss/ +baseurl={{ opensuse_repo_baseurl }} type=yast2 keeppackages=0