From 2af197bd13f77d2a07878b160c00f8ceeebb3c34 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Mon, 30 Oct 2017 18:06:30 +0100 Subject: [PATCH] Add support for openSUSE Change-Id: Id05855f473a2754a4e320bee7e7c21f24873fa12 Signed-off-by: Manuel Buil --- meta/main.yml | 3 +++ tasks/add_odl_zypper_repo.yml | 6 ++++++ tasks/install_odl.yml | 6 ++++-- tasks/install_odl_via_rpm_path.yml | 9 +++++++++ tasks/install_odl_via_rpm_repo.yml | 4 ++++ vars/main.yml | 3 +++ 6 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tasks/add_odl_zypper_repo.yml diff --git a/meta/main.yml b/meta/main.yml index 3991512..9629bcc 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -13,6 +13,9 @@ galaxy_info: versions: - 25 - 26 + - name: OpenSUSE + versions: + - 42 categories: - cloud - clustering diff --git a/tasks/add_odl_zypper_repo.yml b/tasks/add_odl_zypper_repo.yml new file mode 100644 index 0000000..99332e6 --- /dev/null +++ b/tasks/add_odl_zypper_repo.yml @@ -0,0 +1,6 @@ +- name: Add ODL zypper repo + zypper_repository: + repo: "{{ suse_rpm_repo_url }}" + name: opendaylight + auto_import_keys: yes + runrefresh: yes diff --git a/tasks/install_odl.yml b/tasks/install_odl.yml index f96f991..c15f405 100755 --- a/tasks/install_odl.yml +++ b/tasks/install_odl.yml @@ -20,11 +20,13 @@ # Install ODL using Yum repo config - include: install_odl_via_rpm_repo.yml when: - - ansible_os_family == "RedHat" + - (ansible_os_family == "RedHat") or + (ansible_os_family == "Suse") - install_method == "rpm_repo" # Install ODL using rpm URL or a local path to a rpm file - include: install_odl_via_rpm_path.yml when: - - ansible_os_family == "RedHat" + - (ansible_os_family == "RedHat") or + (ansible_os_family == "Suse") - install_method == "rpm_path" diff --git a/tasks/install_odl_via_rpm_path.yml b/tasks/install_odl_via_rpm_path.yml index 08cf0ff..5ac0e80 100644 --- a/tasks/install_odl_via_rpm_path.yml +++ b/tasks/install_odl_via_rpm_path.yml @@ -3,3 +3,12 @@ package: name={{ rpm_path }} state=present + when: ansible_os_family == 'RedHat' + +- name: Install ODL via RPM path + package: + name={{ suse_rpm_path }} + state=present + when: ansible_os_family == 'Suse' + + diff --git a/tasks/install_odl_via_rpm_repo.yml b/tasks/install_odl_via_rpm_repo.yml index 600feba..f6e426d 100644 --- a/tasks/install_odl_via_rpm_repo.yml +++ b/tasks/install_odl_via_rpm_repo.yml @@ -1,5 +1,9 @@ --- - include: add_odl_yum_repo.yml + when: ansible_os_family == "RedHat" + +- include: add_odl_zypper_repo.yml + when: ansible_os_family == "Suse" - name: Install ODL via RPM repo package: diff --git a/vars/main.yml b/vars/main.yml index a1e551a..87a1516 100755 --- a/vars/main.yml +++ b/vars/main.yml @@ -63,6 +63,7 @@ install_method: "rpm_repo" # 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: "https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=packages/rpm/example_repo_configs/opendaylight-6-release.repo;hb=refs/heads/master" +suse_rpm_repo_url: "https://download.opensuse.org/repositories/home:/mosquetero:/branches:/Virtualization:/NFV/openSUSE_Leap_42.3/" # 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" @@ -75,6 +76,8 @@ deb_repo_url: "ppa:odl-team/nitrogen" # NB: This will only take effect when `install_method` is "rpm_path" # Default to the Carbon RPM hosted on the CentOS Community Build System rpm_path: "http://cbs.centos.org/repos/nfv7-opendaylight-60-release/x86_64/os/Packages/opendaylight-6.0.0-1.el7.noarch.rpm" +# Default to the Nitrogen RPM hosted on the openSUSE OBS +suse_rpm_path: "https://download.opensuse.org/repositories/home:/mosquetero:/branches:/Virtualization:/NFV/openSUSE_Leap_42.3/noarch/opendaylight-7.0.0-11.1.noarch.rpm" # This will be passed as the `deb` param to the Ansible `apt` module. # `deb` param docs: "Path to a .deb package on the remote machine. If :// in the path, -- 2.36.6