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
This commit is contained in:
Dirk Mueller 2018-02-23 21:20:10 +01:00
parent 5c0bb18336
commit 7172bd5dc8
2 changed files with 23 additions and 2 deletions

View File

@ -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 - name: Install Suse repository files
become: yes become: yes
template: template:
@ -8,6 +18,17 @@
src: "{{ item }}.j2" src: "{{ item }}.j2"
with_items: with_items:
- etc/zypp/repos.d/repo-oss.repo - etc/zypp/repos.d/repo-oss.repo
- etc/zypp/repos.d/repo-update.repo
notify: notify:
- Update zypper cache - 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")

View File

@ -3,6 +3,6 @@
name=repo-oss name=repo-oss
enabled=1 enabled=1
autorefresh=0 autorefresh=0
baseurl={{ package_mirror }}/distribution/leap/$releasever/repo/oss/ baseurl={{ opensuse_repo_baseurl }}
type=yast2 type=yast2
keeppackages=0 keeppackages=0