]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-common: Add initial support for openSUSE Leap distributions
authorMarkos Chandras <mchandras@suse.de>
Thu, 12 Oct 2017 13:55:20 +0000 (14:55 +0100)
committerMarkos Chandras <mchandras@suse.de>
Tue, 14 Nov 2017 10:51:22 +0000 (10:51 +0000)
openSUSE Leap 42.3 provides support for Ceph Luminous in both the
distribution package and the latest available version in the OBS
repository so add these as the only available installation methods for
openSUSE.

Signed-off-by: Markos Chandras <mchandras@suse.de>
15 files changed:
group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-common/meta/main.yml
roles/ceph-common/tasks/checks/check_mandatory_vars.yml
roles/ceph-common/tasks/checks/check_system.yml
roles/ceph-common/tasks/configure_cluster_name.yml
roles/ceph-common/tasks/installs/configure_suse_repository_installation.yml [new file with mode: 0644]
roles/ceph-common/tasks/installs/install_on_suse.yml [new file with mode: 0644]
roles/ceph-common/tasks/installs/install_suse_packages.yml [new file with mode: 0644]
roles/ceph-common/tasks/installs/suse_obs_repository.yml [new file with mode: 0644]
roles/ceph-common/tasks/main.yml
roles/ceph-common/tasks/misc/ntp_redhat.yml [deleted file]
roles/ceph-common/tasks/misc/ntp_rpm.yml [new file with mode: 0644]
roles/ceph-defaults/defaults/main.yml
site.yml.sample

index 2a75fa6bb1abe4a0878d080162270159b7beb92d..6b42ea21a6925a346a5abbb4e5ad0b45bfe2c757 100644 (file)
@@ -80,6 +80,12 @@ dummy:
 #  - hdparm
 #  - python-setuptools
 
+#suse_package_dependencies:
+#  - python-pycurl
+#  - python-xml
+#  - hdparm
+#  - python-setuptools
+
 # Whether or not to install the ceph-test package.
 #ceph_test: false
 
@@ -116,7 +122,7 @@ dummy:
 # ORIGIN SOURCE
 #
 # Choose between:
-# - 'repository' means that you will get ceph installed through a new repository. Later below choose between 'community', 'rhcs' or 'dev'
+# - 'repository' means that you will get ceph installed through a new repository. Later below choose between 'community', 'rhcs', 'dev' or 'obs'
 # - 'distro' means that no separate repo file will be added
 #  you will get whatever version of Ceph is included in your Linux distro.
 # 'local' means that the ceph binaries will be copied over from the local machine
@@ -134,6 +140,7 @@ dummy:
 #  - dev
 #  - uca
 #  - custom
+#  - obs
 
 
 # REPOSITORY: COMMUNITY VERSION
@@ -201,6 +208,15 @@ dummy:
 #ceph_stable_openstack_release_uca: liberty
 #ceph_stable_release_uca: "{{ansible_lsb.codename}}-updates/{{ceph_stable_openstack_release_uca}}"
 
+# REPOSITORY: openSUSE OBS
+#
+# Enabled when ceph_repository == 'obs'
+#
+# This allows the install of Ceph from the openSUSE OBS repository. The OBS repository
+# usually has newer Ceph releases than the normal distro repository.
+#
+#
+#ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/luminous/openSUSE_Leap_{{ ansible_distribution_version }}/"
 
 # REPOSITORY: DEV
 #
@@ -497,9 +513,9 @@ dummy:
 # do not ever change this here
 #rolling_update: false
 
-
 #####################
 # Docker pull retry #
 #####################
 #docker_pull_retry: 3
 #docker_pull_timeout: "300s"
+
index f95d195b261f5d2c27146570c7f45e3f9786b483..76de30f309ae2346e6451205ea408b3b31251705 100644 (file)
@@ -80,6 +80,12 @@ fetch_directory: ~/ceph-ansible-keys
 #  - hdparm
 #  - python-setuptools
 
+#suse_package_dependencies:
+#  - python-pycurl
+#  - python-xml
+#  - hdparm
+#  - python-setuptools
+
 # Whether or not to install the ceph-test package.
 #ceph_test: false
 
@@ -116,7 +122,7 @@ fetch_directory: ~/ceph-ansible-keys
 # ORIGIN SOURCE
 #
 # Choose between:
-# - 'repository' means that you will get ceph installed through a new repository. Later below choose between 'community', 'rhcs' or 'dev'
+# - 'repository' means that you will get ceph installed through a new repository. Later below choose between 'community', 'rhcs', 'dev' or 'obs'
 # - 'distro' means that no separate repo file will be added
 #  you will get whatever version of Ceph is included in your Linux distro.
 # 'local' means that the ceph binaries will be copied over from the local machine
@@ -134,6 +140,7 @@ ceph_repository: rhcs
 #  - dev
 #  - uca
 #  - custom
+#  - obs
 
 
 # REPOSITORY: COMMUNITY VERSION
@@ -201,6 +208,15 @@ ceph_repository: rhcs
 #ceph_stable_openstack_release_uca: liberty
 #ceph_stable_release_uca: "{{ansible_lsb.codename}}-updates/{{ceph_stable_openstack_release_uca}}"
 
+# REPOSITORY: openSUSE OBS
+#
+# Enabled when ceph_repository == 'obs'
+#
+# This allows the install of Ceph from the openSUSE OBS repository. The OBS repository
+# usually has newer Ceph releases than the normal distro repository.
+#
+#
+#ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/luminous/openSUSE_Leap_{{ ansible_distribution_version }}/"
 
 # REPOSITORY: DEV
 #
@@ -497,9 +513,9 @@ ceph_repository: rhcs
 # do not ever change this here
 #rolling_update: false
 
-
 #####################
 # Docker pull retry #
 #####################
 #docker_pull_retry: 3
 #docker_pull_timeout: "300s"
+
index 66e2d4b47785c7ff2ecbe6e84756dbc08b8a9e15..50c0ab6992144d9cd7efa4c7f105a9bff955ce24 100644 (file)
@@ -11,6 +11,9 @@ galaxy_info:
     - name: EL
       versions:
         - 7
+    - name: opensuse
+      versions:
+        - 42.3
   categories:
     - system
 dependencies: []
index 239e6c1c9918ab814bdd2c3264c1290a0d12ffee..b4ca5b240a6b507866e768321de43eb0a18587b4 100644 (file)
@@ -28,7 +28,7 @@
     msg: "make sure ceph_stable_release ( {{ ceph_stable_release }} ) is set to a release name (e.g: luminous), http://docs.ceph.com/docs/master/release-notes/"
   when:
     - ceph_stable_release == 'dummy'
-    - ceph_repository not in ['rhcs', 'dev']
+    - ceph_repository not in ['rhcs', 'dev', 'obs']
   tags:
     - package-install
 
@@ -38,7 +38,7 @@
   when:
     - ceph_stable_release not in ceph_release_num
     - ceph_origin == 'repository'
-    - ceph_repository not in ['rhcs', 'dev']
+    - ceph_repository not in ['rhcs', 'dev', 'obs']
   tags:
     - package-install
 
index 06055f7955a704de54b5369f0df495b7c69181f3..1e082050cef18b3555439430cd385837f993ecf6 100644 (file)
@@ -15,7 +15,7 @@
   fail:
     msg: "Distribution not supported {{ ansible_os_family }}"
   when:
-    - ansible_os_family not in ['Debian', 'RedHat', 'ClearLinux']
+    - ansible_os_family not in ['Debian', 'RedHat', 'ClearLinux', 'Suse']
 
 - name: fail on unsupported distribution for red hat ceph storage
   fail:
     - ceph_repository == 'uca'
     - ansible_distribution != 'Ubuntu'
 
+- name: fail on unsupported openSUSE distribution
+  fail:
+    msg: "Distribution not supported: {{ ansible_distribution }}"
+  when:
+    - ansible_distribution == 'openSUSE Leap'
+    - ansible_distribution_version | version_compare('42.3', '<')
+
 - name: fail on unsupported ansible version
   fail:
     msg: "Ansible version must be >= 2.3.x, please update!"
index 1c6dd3c789f37b1d67710ce05f08f18147ea7b60..d516c27f55270072d0a5e573165a039d6180aa3a 100644 (file)
@@ -7,7 +7,7 @@
     line: "CLUSTER={{ cluster }}"
     regexp: "^CLUSTER="
   when:
-    - ansible_os_family == "RedHat"
+    - ansible_os_family in ["RedHat", "Suse"]
 
 # NOTE(leseb): we are performing the following check
 # to ensure any Jewel installation will not fail.
diff --git a/roles/ceph-common/tasks/installs/configure_suse_repository_installation.yml b/roles/ceph-common/tasks/installs/configure_suse_repository_installation.yml
new file mode 100644 (file)
index 0000000..15665aa
--- /dev/null
@@ -0,0 +1,5 @@
+---
+- name: include suse_obs_repository.yml
+  include: suse_obs_repository.yml
+  when:
+    - ceph_repository == 'obs'
diff --git a/roles/ceph-common/tasks/installs/install_on_suse.yml b/roles/ceph-common/tasks/installs/install_on_suse.yml
new file mode 100644 (file)
index 0000000..57b4a2e
--- /dev/null
@@ -0,0 +1,24 @@
+---
+# SUSE only supports the following:
+# - ceph_origin == 'distro'
+# - ceph_origin == 'repository' and ceph_repository == 'obs'
+- name: Check for supported installation method on suse
+  fail:
+    msg: "Unsupported installation method origin:{{ ceph_origin }} repo:{{ ceph_repository }}'"
+  when:
+    - ceph_origin != 'distro' or (ceph_origin == 'repository' and ceph_repository != 'obs')
+
+- name: include configure_suse_repository_installation.yml
+  include: configure_suse_repository_installation.yml
+  when:
+    - ceph_origin == 'repository'
+
+- name: install dependencies
+  zypper:
+    name: "{{ item }}"
+    state: present
+    update_cache: yes
+  with_items: "{{ suse_package_dependencies }}"
+
+- name: include install_suse_packages.yml
+  include: install_suse_packages.yml
diff --git a/roles/ceph-common/tasks/installs/install_suse_packages.yml b/roles/ceph-common/tasks/installs/install_suse_packages.yml
new file mode 100644 (file)
index 0000000..db52186
--- /dev/null
@@ -0,0 +1,54 @@
+---
+- name: install suse dependencies
+  package:
+    name: "{{ suse_package_dependencies }}"
+    state: present
+  when:
+    - ansible_distribution == 'Suse'
+
+- name: install suse ceph-common
+  package:
+    name: "ceph-common"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+
+- name: install suse ceph-mon package
+  package:
+    name: "ceph-mon"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - mon_group_name in group_names
+
+- name: install suse ceph-osd package
+  package:
+    name: "ceph-osd"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - osd_group_name in group_names
+
+- name: install suse ceph-fuse package
+  package:
+    name: "ceph-fuse"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - client_group_name in group_names
+
+- name: install suse ceph-base package
+  package:
+    name: "ceph-base"
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - client_group_name in group_names
+
+- name: install suse ceph-test package
+  package:
+    name: ceph-test
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - ceph_test
+
+- name: install suse ceph-radosgw package
+  package:
+    name: ceph-radosgw
+    state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+  when:
+    - rgw_group_name in group_names
diff --git a/roles/ceph-common/tasks/installs/suse_obs_repository.yml b/roles/ceph-common/tasks/installs/suse_obs_repository.yml
new file mode 100644 (file)
index 0000000..4f13a40
--- /dev/null
@@ -0,0 +1,8 @@
+---
+- name: configure openSUSE ceph OBS repository
+  zypper_repository:
+    name: "OBS:filesystems:ceph"
+    state: present
+    uri: "{{ ceph_obs_repo }}"
+    auto_import_keys: yes
+    autorefresh: yes
index 314f4aa76d210d48fad62f58521a02f5b684ca4f..5aee03eb016f2094ce10e6d0bed752c6da9be403 100644 (file)
   # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
   static: False
 
+- name: include installs/install_on_suse.yml
+  include: installs/install_on_suse.yml
+  when:
+    - ansible_os_family == 'Suse'
+  tags:
+    - package-install
+  # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
+  static: False
+
 - name: include installs/install_on_debian.yml
   include: installs/install_on_debian.yml
   when:
   # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
   static: False
 
-- name: include ntp setup tasks
-  include: "misc/ntp_{{ ansible_os_family | lower }}.yml"
+- name: include ntp debian setup tasks
+  include: "misc/ntp_debian.yml"
+  when:
+    - ansible_os_family == 'Debian'
+    - ntp_service_enabled
+  # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
+  static: False
+
+- name: include ntp rpm setup tasks
+  include: "misc/ntp_rpm.yml"
   when:
-    - ansible_os_family in ['RedHat', 'Debian']
+    - ansible_os_family in ['RedHat', 'Suse']
     - ntp_service_enabled
   # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
   static: False
diff --git a/roles/ceph-common/tasks/misc/ntp_redhat.yml b/roles/ceph-common/tasks/misc/ntp_redhat.yml
deleted file mode 100644 (file)
index 7e34815..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
----
-- name: install ntp on redhat
-  package:
-    name: ntp
-    state: present
-
-- name: start the ntp service
-  service:
-    name: ntpd
-    enabled: yes
-    state: started
diff --git a/roles/ceph-common/tasks/misc/ntp_rpm.yml b/roles/ceph-common/tasks/misc/ntp_rpm.yml
new file mode 100644 (file)
index 0000000..91d2d7d
--- /dev/null
@@ -0,0 +1,11 @@
+---
+- name: install ntp
+  package:
+    name: ntp
+    state: present
+
+- name: start the ntp service
+  service:
+    name: ntpd
+    enabled: yes
+    state: started
index 0721f5bb5d9680220df90e75eb17e1b96b8426ba..ec2fcae0b907973b533064709bddbf7b00b25ae5 100644 (file)
@@ -72,6 +72,12 @@ redhat_package_dependencies:
   - hdparm
   - python-setuptools
 
+suse_package_dependencies:
+  - python-pycurl
+  - python-xml
+  - hdparm
+  - python-setuptools
+
 # Whether or not to install the ceph-test package.
 ceph_test: false
 
@@ -108,7 +114,7 @@ ceph_custom: False # backward compatibility with stable-2.2, will disappear in s
 # ORIGIN SOURCE
 #
 # Choose between:
-# - 'repository' means that you will get ceph installed through a new repository. Later below choose between 'community', 'rhcs' or 'dev'
+# - 'repository' means that you will get ceph installed through a new repository. Later below choose between 'community', 'rhcs', 'dev' or 'obs'
 # - 'distro' means that no separate repo file will be added
 #  you will get whatever version of Ceph is included in your Linux distro.
 # 'local' means that the ceph binaries will be copied over from the local machine
@@ -126,6 +132,7 @@ valid_ceph_repository:
   - dev
   - uca
   - custom
+  - obs
 
 
 # REPOSITORY: COMMUNITY VERSION
@@ -193,6 +200,15 @@ ceph_rhcs_cdn_debian_repo_version: "/3-release/" # for GA, later for updates use
 #ceph_stable_openstack_release_uca: liberty
 #ceph_stable_release_uca: "{{ansible_lsb.codename}}-updates/{{ceph_stable_openstack_release_uca}}"
 
+# REPOSITORY: openSUSE OBS
+#
+# Enabled when ceph_repository == 'obs'
+#
+# This allows the install of Ceph from the openSUSE OBS repository. The OBS repository
+# usually has newer Ceph releases than the normal distro repository.
+#
+#
+#ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/luminous/openSUSE_Leap_{{ ansible_distribution_version }}/"
 
 # REPOSITORY: DEV
 #
index 1585a6e88595dbbcf60334f3f9fc0e7792892dbb..f771ade0931754c969b26158a88080a18a0c5fda 100644 (file)
       when:
         - systempython2.stat.exists is undefined or systempython2.stat.exists == false
 
+    - name: install python2 for opensuse
+      raw: sudo zypper -n install python-base creates=/usr/bin/python2.7
+      ignore_errors: yes
+      when:
+        - systempython2.stat.exists is undefined or systempython2.stat.exists == false
+
     - name: gather facts
       setup:
       when: