]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
common: iso install on Debian is supported by rhcs 2003/head
authorSébastien Han <seb@redhat.com>
Thu, 5 Oct 2017 16:33:17 +0000 (18:33 +0200)
committerSébastien Han <seb@redhat.com>
Thu, 5 Oct 2017 16:57:09 +0000 (18:57 +0200)
Also adds support for RCSH installation on Debian.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-common/tasks/checks/check_mandatory_vars.yml
roles/ceph-common/tasks/installs/debian_dev_repository.yml
roles/ceph-common/tasks/installs/debian_rhcs_repository.yml
roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_install.yml
roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_install_debian.yml [new file with mode: 0644]

index fc5143c6749370247785422c772d2865d8690e03..8186d008d068dd733ab0b10cf3121ff23cf72659 100644 (file)
   tags:
     - package-install
 
-- name: verify that ceph_rhcs_cdn_debian_repo url is valid for red hat storage
-  fail:
-    msg: "iso installation is not supported by the Ceph Debian rhcs version"
-  when:
-    - ceph_origin == 'repository'
-    - ceph_repository == 'rhcs'
-    - ceph_repository_type == 'iso'
-    - ansible_os_family == 'Debian'
-  tags:
-    - package-install
-
 - name: make sure monitor_interface or monitor_address is defined
   fail:
     msg: "you must set monitor_interface or monitor_address"
index b19501e3a4e01785a834cc049fcc167a52bb0f03..c975540f7bdf6d7931472bcd490d452a0f0627de 100644 (file)
@@ -16,7 +16,7 @@
     url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_distribution | lower }}/{{ ansible_distribution_release }}/flavors/{{ nfs_ganesha_flavor }}/repo
     return_content: yes
   register: nfs_ganesha_apt_repo
-  when: 
+  when:
     - nfs_group_name in group_names
     - nfs_ganesha_dev
 
@@ -27,7 +27,7 @@
     owner: root
     group: root
     backup: yes
-  when: 
+  when:
     - nfs_group_name in group_names
     - nfs_ganesha_dev
 
index 9dcb0ba7ac361a8dc2eb8f22e304783a6c035914..5bf4418b25e18c541f8dce8b956b2c4c068778f7 100644 (file)
@@ -1,4 +1,9 @@
 ---
+- name: include prerequisite_rhcs_iso_install_debian.yml
+  include: prerequisite_rhcs_iso_install_debian.yml
+  when:
+    - ceph_repository_type == 'iso'
+
 - name: include prerequisite_rhcs_cdn_install_debian.yml
   include: prerequisite_rhcs_cdn_install_debian.yml
   when:
index b8a20394e9063019f54457c2d002e09af45c38ce..d95bc66f5450967ec19882260700963ddf1948e2 100644 (file)
@@ -1,5 +1,5 @@
 ---
-- name: create red hat storage package directories
+- name: create red hat storage package directories for redhat systems
   file:
     path: "{{ item }}"
     state: directory
@@ -7,7 +7,7 @@
     - "{{ ceph_rhcs_mount_path }}"
     - "{{ ceph_rhcs_repository_path }}"
 
-- name: ensure destination iso directory exists
+- name: ensure destination iso directory exists for redhat systems
   file:
     path: "{{ ceph_rhcs_iso_path | dirname }}"
     state: directory
   when:
     - ceph_rhcs_iso_path | dirname != '/'
 
-- name: fetch the red hat storage iso from the ansible server
+- name: fetch the red hat storage iso from the ansible server for redhat systems
   copy:
     src: "{{ ceph_rhcs_iso_path }}"
     dest: "{{ ceph_rhcs_iso_path }}"
 
 # assumption: ceph_rhcs_mount_path does not specify directory
 
-- name: mount red hat storage iso file
+- name: mount red hat storage iso file for redhat systems
   mount:
     name: "{{ ceph_rhcs_mount_path }}"
     src: "{{ ceph_rhcs_iso_path }}"
     passno: 2
     state: mounted
 
-- name: copy red hat storage iso content
+- name: copy red hat storage iso content for redhat systems
   shell: cp -r {{ ceph_rhcs_mount_path }}/* {{ ceph_rhcs_repository_path }}
   args:
     creates: "{{ ceph_rhcs_repository_path }}/README"
 
-- name: unmount red hat storage iso file
+- name: unmount red hat storage iso file for redhat systems
   mount:
     name: "{{ ceph_rhcs_mount_path }}"
     src: "{{ ceph_rhcs_iso_path }}"
     fstype: iso9660
     state: unmounted
 
-- name: install red hat storage repository key
+- name: install red hat storage repository key for redhat systems
   rpm_key:
     key: "{{ ceph_rhcs_repository_path }}/RPM-GPG-KEY-redhat-release"
     state: present
 
-- name: add red hat storage repository
+- name: add red hat storage repository for redhat systems
   template:
     src: "{{ role_path }}/templates/redhat_storage_repo.j2"
     dest: /etc/yum.repos.d/rh_storage.repo
diff --git a/roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_install_debian.yml b/roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_install_debian.yml
new file mode 100644 (file)
index 0000000..1d35ab2
--- /dev/null
@@ -0,0 +1,57 @@
+---
+- name: create red hat storage package directories for debian systems
+  file:
+    path: "{{ item }}"
+    state: directory
+  with_items:
+    - "{{ ceph_rhcs_mount_path }}"
+    - "{{ ceph_rhcs_repository_path }}"
+
+- name: ensure destination iso directory exists for debian systems
+  file:
+    path: "{{ ceph_rhcs_iso_path | dirname }}"
+    state: directory
+    recurse: yes
+  when:
+    - ceph_rhcs_iso_path | dirname != '/'
+
+- name: fetch the red hat storage iso from the ansible server for debian systems
+  copy:
+    src: "{{ ceph_rhcs_iso_path }}"
+    dest: "{{ ceph_rhcs_iso_path }}"
+
+# assumption: ceph_rhcs_mount_path does not specify directory
+
+- name: mount red hat storage iso file for debian systems
+  mount:
+    name: "{{ ceph_rhcs_mount_path }}"
+    src: "{{ ceph_rhcs_iso_path }}"
+    fstype: iso9660
+    opts: ro,loop,noauto
+    passno: 2
+    state: mounted
+
+- name: copy red hat storage iso content for debian systems
+  shell: cp -r {{ ceph_rhcs_mount_path }}/* {{ ceph_rhcs_repository_path }}
+  args:
+    creates: "{{ ceph_rhcs_repository_path }}/README"
+
+- name: unmount red hat storage iso file
+  mount:
+    name: "{{ ceph_rhcs_mount_path }}"
+    src: "{{ ceph_rhcs_iso_path }}"
+    fstype: iso9660
+    state: unmounted
+
+- name: install red hat storage repository key for debian systems
+  apt_key:
+    file: "{{ ceph_rhcs_repository_path }}/RPM-GPG-KEY-redhat-release"
+    state: present
+
+- name: add red hat storage repository for debian systems
+  template:
+    src: "{{ role_path }}/templates/redhat_storage_repo.j2"
+    dest: /etc/apt/sources.list.d/rh_storage.list
+    owner: root
+    group: root
+    mode: 0644