From ce56777d43dd63d742583b033971f3392fe48730 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Tue, 3 Apr 2018 10:21:15 +0200 Subject: [PATCH] Build the repo url when odl_version is passed XCI might pass the odl_version which should generate a repo url pointing to different snaps repo. So far we were doing this at XCI side but it makes more sense to do it here as the odl_version is needed for template processing: https://git.opendaylight.org/gerrit/#/c/70267/ Change-Id: I2c1cbb86060ce05c87442bcc247fc0679bc9587e Signed-off-by: Manuel Buil --- tasks/add_odl_zypper_repo.yml | 15 +++++++++++++++ vars/main.yml | 14 +++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/tasks/add_odl_zypper_repo.yml b/tasks/add_odl_zypper_repo.yml index 99332e6..2f04e57 100644 --- a/tasks/add_odl_zypper_repo.yml +++ b/tasks/add_odl_zypper_repo.yml @@ -1,6 +1,21 @@ +- name: Add repo from file + block: + - name: Download ODL zypper repo + get_url: + url: "{{ suse_rpm_repo_url }}" + dest: /tmp/opendaylight.repo + - name: Add ODL zypper repo + zypper_repository: + repo: "/tmp/opendaylight.repo" + auto_import_keys: yes + disable_gpg_check: yes + runrefresh: yes + when: odl_version is defined + - name: Add ODL zypper repo zypper_repository: repo: "{{ suse_rpm_repo_url }}" name: opendaylight auto_import_keys: yes runrefresh: yes + when: odl_version is undefined diff --git a/vars/main.yml b/vars/main.yml index 020c551..9202936 100755 --- a/vars/main.yml +++ b/vars/main.yml @@ -60,14 +60,22 @@ akka_remoting_port: 2550 # deb_path: Install ODL .deb from a local path or remote URL install_method: "rpm_repo" +# We need this dictionary to translate from ODL version to the version number +odl_version_dict: + master: 9 + fluorine: 9 + oxygen: 8 + nitrogen: 7 + # URL of the .repo config to use when installing ODL from a repo # NB: This will only take effect when `install_method` is "rpm_repo" -rpm_repo_url: "{{ odl_repo_url | default('https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=packages/rpm/example_repo_configs/opendaylight-8-devel.repo') }}" -suse_rpm_repo_url: "{{ odl_repo_url | default('https://download.opensuse.org/repositories/Virtualization:/NFV/openSUSE_Leap_42.3/') }}" +rpm_repo_url: "{% if odl_version is defined %}https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=packages/rpm/example_repo_configs/opendaylight-{{ odl_version_dict[odl_version] }}-devel.repo{% else %}https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=packages/rpm/example_repo_configs/opendaylight-8-devel.repo{% endif %}" +suse_rpm_repo_url: "{% if odl_version is defined %}https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=packages/rpm/example_repo_configs/opendaylight-{{ odl_version_dict[odl_version] }}-opensuse-devel.repo{% else %}https://download.opensuse.org/repositories/Virtualization:/NFV/openSUSE_Leap_42.3/{% endif %}" # URL of the deb repository to use when installing ODL from a repo # NB: This will only take effect when `install_method` is "deb_repo" -deb_repo_url: "{{ odl_repo_url | default('ppa:odl-team/oxygen') }}" +# TODO: When deb snaps are built, point to a repo like rpm +deb_repo_url: "ppa:odl-team/oxygen" # This will be passed as the `name` param to the Ansible `yum` module. # `name` param docs: "You can also pass a url or a local path to a rpm file." -- 2.36.6