]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add red hat storage cdn installation 306/head
authorleseb <seb@redhat.com>
Thu, 2 Jul 2015 16:23:11 +0000 (18:23 +0200)
committerleseb <seb@redhat.com>
Fri, 3 Jul 2015 10:38:17 +0000 (12:38 +0200)
Signed-off-by: leseb <seb@redhat.com>
group_vars/all
roles/ceph-common/defaults/main.yml
roles/ceph-common/tasks/install_on_redhat.yml
roles/ceph-common/tasks/main.yml
roles/ceph-common/tasks/prerequisite_rh_storage.yml [deleted file]
roles/ceph-common/tasks/prerequisite_rh_storage_cdn_install.yml [new file with mode: 0644]
roles/ceph-common/tasks/prerequisite_rh_storage_iso_install.yml [new file with mode: 0644]
roles/ceph-common/templates/redhat_storage_repo.j2
roles/ceph-mon/tasks/main.yml
roles/ceph-radosgw/tasks/start_radosgw.yml

index a9630984e8f538086441559d333e5bd30ee41425..308b9ddd935a0cc3f85383f40456be07554a4887 100644 (file)
@@ -52,10 +52,11 @@ dummy:
 # on RHEL 7.
 #
 #ceph_stable_rh_storage: false
-#ceph_stable_rh_storage_url: (can be found at https://access.redhat.com/products/red-hat-ceph-storage/get-started)
-#ceph_stable_rh_storage_iso_checksum:
-#ceph_stable_rh_storage_mount_path: /tmp/rh-storage-repo
-#ceph_stable_rh_storage_download_path: /tmp/
+#ceph_stable_rh_storage_cdn_install: true # assumes all the nodes can connect to cdn.redhat.com
+#ceph_stable_rh_storage_iso_install: false # usually used when nodes don't have access to cdn.redhat.com
+#ceph_stable_rh_storage_iso_path:
+#ceph_stable_rh_storage_mount_path: /tmp/rh-storage-mount
+#ceph_stable_rh_storage_repository_path: /tmp/rh-storage-repo # where to copy iso's content
 
 # DEV
 # ###
index 9c0a846c8893a8a0a6473390701c08fcc772e2ca..b215387687ddd50ae2e21a737249e64e633d67fd 100644 (file)
@@ -49,11 +49,11 @@ ceph_stable_ice: false # use Inktank Ceph Enterprise
 # on RHEL 7.\r
 #\r
 ceph_stable_rh_storage: false\r
-#ceph_stable_rh_storage_url: (can be found at https://access.redhat.com/products/red-hat-ceph-storage/get-started)\r
-#ceph_stable_rh_storage_iso_checksum:\r
-ceph_stable_rh_storage_mount_path: /tmp/rh-storage-repo\r
-ceph_stable_rh_storage_download_path: /tmp/\r
-\r
+ceph_stable_rh_storage_cdn_install: true # assumes all the nodes can connect to cdn.redhat.com\r
+ceph_stable_rh_storage_iso_install: false # usually used when nodes don't have access to cdn.redhat.com\r
+#ceph_stable_rh_storage_iso_path:\r
+ceph_stable_rh_storage_mount_path: /tmp/rh-storage-mount\r
+ceph_stable_rh_storage_repository_path: /tmp/rh-storage-repo # where to copy iso's content\r
 \r
 # DEV\r
 # ###\r
index 1d897c2449612a3b8f2a9bdf0deb60747086a1c4..1e6def9faac675fe4200ff682bc50040ff021f64 100644 (file)
 
 - name: install red hat storage repository key
   rpm_key: >
-    key={{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release
+    key={{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release
     state=present
-  when: ceph_stable_rh_storage
+  when:
+    ceph_stable_rh_storage and
+    ceph_stable_rh_storage_iso_install
 
 - name: add Ceph stable repository
   yum: name=http://ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm
@@ -60,7 +62,9 @@
     owner=root
     group=root
     mode=0644
-  when: ceph_stable_rh_storage
+  when:
+    ceph_stable_rh_storage and
+    ceph_stable_rh_storage_iso_install
 
 - name: install Ceph
   yum: >
index def4774741da91376d787e53c3044512cf4d5cb2..0a00d38df2e903d9ce54e2f5e63d52d9d275dd28 100644 (file)
@@ -7,8 +7,11 @@
 - include: prerequisite_ice.yml
   when: ceph_stable_ice
 
-- include: prerequisite_rh_storage.yml
-  when: ceph_stable_rh_storage
+- include: prerequisite_rh_storage_iso_install.yml
+  when: ceph_stable_rh_storage_iso_install
+
+- include: prerequisite_rh_storage_cdn_install.yml
+  when: ceph_stable_rh_storage_cdn_install
 
 - include: install_on_redhat.yml
   when: ansible_os_family == 'RedHat'
diff --git a/roles/ceph-common/tasks/prerequisite_rh_storage.yml b/roles/ceph-common/tasks/prerequisite_rh_storage.yml
deleted file mode 100644 (file)
index c4bbd72..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
----
-- name: create red hat storage package directory
-  file: >
-    path={{ ceph_stable_rh_storage_mount_path }}
-    state=directory
-
-- name: get red hat storage packages
-  get_url: >
-    url={{ ceph_stable_rh_storage_url }}
-    dest={{ ceph_stable_rh_storage_download_path }}/rh-storage.iso
-    sha256sum={{ ceph_stable_rh_storage_iso_checksum }}
-
-- name: mount red hat storage iso file
-  mount: >
-    name={{ ceph_stable_rh_storage_mount_path }}
-    src={{ ceph_stable_rh_storage_download_path }}/rh-storage.iso
-    fstype=iso9660
-    state=mounted
diff --git a/roles/ceph-common/tasks/prerequisite_rh_storage_cdn_install.yml b/roles/ceph-common/tasks/prerequisite_rh_storage_cdn_install.yml
new file mode 100644 (file)
index 0000000..579afd6
--- /dev/null
@@ -0,0 +1,17 @@
+---
+- name: determine if node is registered with subscription-manager.
+  command: subscription-manager identity
+  register: subscription
+  changed_when: false
+
+- name: enable red hat storage monitor repository
+  command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-mon-rpms
+  when: mon_group_name in group_names
+
+- name: enable red hat storage osd repository
+  command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-osd-rpms
+  when: osd_group_name in group_names
+
+- name: enable red hat storage rados gateway repository
+  command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-tools-rpms
+  when: rgw_group_name in group_names
diff --git a/roles/ceph-common/tasks/prerequisite_rh_storage_iso_install.yml b/roles/ceph-common/tasks/prerequisite_rh_storage_iso_install.yml
new file mode 100644 (file)
index 0000000..ec9895d
--- /dev/null
@@ -0,0 +1,33 @@
+---
+- name: create red hat storage package directories
+  file: >
+    path={{ item }}
+    state=directory
+  with_items:
+    - "{{ ceph_stable_rh_storage_mount_path }}"
+    - "{{ ceph_stable_rh_storage_repository_path }}"
+
+- name: fetch the red hat storage iso from the ansible server
+  fetch: >
+    src={{ ceph_stable_rh_storage_iso_path }}
+    dest={{ ceph_stable_rh_storage_iso_path }}
+    flat=yes
+
+- name: mount red hat storage iso file
+  mount: >
+    name={{ ceph_stable_rh_storage_mount_path }}
+    src={{ ceph_stable_rh_storage_iso_path }}
+    fstype=iso9660
+    state=mounted
+
+- name: copy red hat storage iso content
+  shell:
+    cp -r {{ ceph_stable_rh_storage_mount_path }}/* {{ ceph_stable_rh_storage_repository_path }}
+    creates={{ ceph_stable_rh_storage_repository_path }}/README
+
+- name: mount red hat storage iso file
+  mount: >
+    name={{ ceph_stable_rh_storage_mount_path }}
+    src={{ ceph_stable_rh_storage_iso_path }}
+    fstype=iso9660
+    state=unmounted
index 4af8d34cebf4759fa46a269e018327a19a00fae6..2b92ecabef26511933c144bbdfea3724b12b018f 100644 (file)
@@ -1,36 +1,36 @@
 # {{ ansible_managed }}
 [rh_storage_mon]
 name=Red Hat Storage Ceph - local packages for Ceph
-baseurl=file://{{ ceph_stable_rh_storage_mount_path }}/MON
+baseurl=file://{{ ceph_stable_rh_storage_repository_path }}/MON
 enabled=1
 gpgcheck=1
 type=rpm-md
 priority=1
-gpgkey=file://{{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release
+gpgkey=file://{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release
 
 [rh_storage_osd]
 name=Red Hat Storage Ceph - local packages for Ceph
-baseurl=file://{{ ceph_stable_rh_storage_mount_path }}/OSD
+baseurl=file://{{ ceph_stable_rh_storage_repository_path }}/OSD
 enabled=1
 gpgcheck=1
 type=rpm-md
 priority=1
-gpgkey=file://{{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release
+gpgkey=file://{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release
 
 [rh_storage_calamari]
 name=Red Hat Storage Ceph - local packages for Ceph
-baseurl=file://{{ ceph_stable_rh_storage_mount_path }}/Calamari
+baseurl=file://{{ ceph_stable_rh_storage_repository_path }}/Calamari
 enabled=1
 gpgcheck=1
 type=rpm-md
 priority=1
-gpgkey=file://{{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release
+gpgkey=file://{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release
 
 [rh_storage_installer]
 name=Red Hat Storage Ceph - local packages for Ceph
-baseurl=file://{{ ceph_stable_rh_storage_mount_path }}/Installer
+baseurl=file://{{ ceph_stable_rh_storage_repository_path }}/Installer
 enabled=1
 gpgcheck=1
 type=rpm-md
 priority=1
-gpgkey=file://{{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release
+gpgkey=file://{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release
index bcbc52d98ddd998826d76aa0f5cff42677ca15a9..a1c450299c553fff38da761651b5559b0f0c52d6 100644 (file)
@@ -11,7 +11,7 @@
 - include: create_mds_filesystems.yml
   when:
     not ceph_containerized_deployment and
-    mds_group_name is defined
+    groups[mds_group_name] is defined
 
 - include: secure_cluster.yml
   when:
index df39dbdf80a1e806ce54d31e6e21bec59058c2f7..53a5107494bb33683249eea371b85c6492886aca 100644 (file)
     ansible_os_family != 'RedHat'
 
 - name: start RGW
-  service: name=radosgw-all state=started
+  service: >
+    name=radosgw-all
+    state=started
   when: ansible_distribution == "Ubuntu"
 
 - name: start RGW
-  service: name=ceph-radosgw state=started
+  service: >
+    name=ceph-radosgw
+    state=started
+    enabled=yes
   when: ansible_os_family == 'RedHat'