Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add openSUSE support #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ env:
TOXENV=functional_stable
docker_image_tag=centos-7
CACHE_NAME=cent7
# - >
# TOXENV=functional_stable
# docker_image_tag=opensuse-42.2
# CACHE_NAME=suse42
# docker_command=/usr/lib/systemd/systemd
- >
TOXENV=functional_stable
docker_image_tag=opensuse-42.2
CACHE_NAME=suse42
docker_command=/usr/lib/systemd/systemd
before_install:
# Load cached docker images
- if [[ -d ${cache_dir} ]]; then ls ${cache_dir}/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
Expand Down
4 changes: 4 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ galaxy_info:
- name: EL
versions:
- 7
- name: opensuse
- 42.1
- 42.2
- 42.3
categories:
- cloud
- development
Expand Down
6 changes: 6 additions & 0 deletions tasks/etcd_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@
- ansible_pkg_mgr == 'yum'
tags:
- install-yum

- include: etcd_install_zypper.yml
when:
- ansible_pkg_mgr == 'zypper'
tags:
- install-zypper
49 changes: 49 additions & 0 deletions tasks/etcd_install_zypper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# Copyright 2017, SUSE LINUX GmbH.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Add etcd zypper repository
# zypper_repository/auto_import_keys added in 2.2 so we need to
# manually refresh the repository and import the keys in order to
# work with older ansible versions.
zypper_repository:
refresh: yes
name: "{{ item.name }}"
repo: "{{ item.uri }}"
register: zypper_repository_added
with_items: "{{ etcd_zypper_repo }}"
tags:
- etcd-zypper-repositories

- name: Refresh etcd zypper repository
command: zypper --gpg-auto-import-keys ref
when: zypper_repository_added.changed
# We need to run this right after we add the repos and before
# we install any packages so it can't be a handler unless we move
# everything to pre_tasks
tags:
- skip_ansible_lint
- etcd-zypper-repositories

- name: Install etcd zypper packages
zypper:
name: "{{ item }}"
state: "{{ etcd_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ etcd_packages }}"
tags:
- etcd-zypper-packages
22 changes: 22 additions & 0 deletions vars/suse-42.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Copyright 2017, SUSE LINUX GmbH.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

etcd_zypper_repo:
- name: "OBS:Virtualization_containers"
uri: "http://download.opensuse.org/repositories/Virtualization:/containers/openSUSE_Leap_{{ ansible_distribution_version }}/"

etcd_packages:
- etcd
- etcdctl