From: leseb Date: Thu, 2 Jul 2015 16:23:11 +0000 (+0200) Subject: Add red hat storage cdn installation X-Git-Tag: v1.0.0~187^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=77b56501806dd6a67734c0d285402a8288bcf147;p=ceph-ansible.git Add red hat storage cdn installation Signed-off-by: leseb --- diff --git a/group_vars/all b/group_vars/all index a9630984e..308b9ddd9 100644 --- a/group_vars/all +++ b/group_vars/all @@ -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 # ### diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 9c0a846c8..b21538768 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -49,11 +49,11 @@ ceph_stable_ice: false # use Inktank Ceph Enterprise # 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 # ### diff --git a/roles/ceph-common/tasks/install_on_redhat.yml b/roles/ceph-common/tasks/install_on_redhat.yml index 1d897c244..1e6def9fa 100644 --- a/roles/ceph-common/tasks/install_on_redhat.yml +++ b/roles/ceph-common/tasks/install_on_redhat.yml @@ -30,9 +30,11 @@ - 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: > diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index def477474..0a00d38df 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -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 index c4bbd724f..000000000 --- a/roles/ceph-common/tasks/prerequisite_rh_storage.yml +++ /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 index 000000000..579afd6aa --- /dev/null +++ b/roles/ceph-common/tasks/prerequisite_rh_storage_cdn_install.yml @@ -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 index 000000000..ec9895d3b --- /dev/null +++ b/roles/ceph-common/tasks/prerequisite_rh_storage_iso_install.yml @@ -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 diff --git a/roles/ceph-common/templates/redhat_storage_repo.j2 b/roles/ceph-common/templates/redhat_storage_repo.j2 index 4af8d34ce..2b92ecabe 100644 --- a/roles/ceph-common/templates/redhat_storage_repo.j2 +++ b/roles/ceph-common/templates/redhat_storage_repo.j2 @@ -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 diff --git a/roles/ceph-mon/tasks/main.yml b/roles/ceph-mon/tasks/main.yml index bcbc52d98..a1c450299 100644 --- a/roles/ceph-mon/tasks/main.yml +++ b/roles/ceph-mon/tasks/main.yml @@ -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: diff --git a/roles/ceph-radosgw/tasks/start_radosgw.yml b/roles/ceph-radosgw/tasks/start_radosgw.yml index df39dbdf8..53a510749 100644 --- a/roles/ceph-radosgw/tasks/start_radosgw.yml +++ b/roles/ceph-radosgw/tasks/start_radosgw.yml @@ -12,9 +12,14 @@ 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'