Merge pull request #2003 from ceph/debian-iso

[skip ci] common: iso install on Debian is supported by rhcs
pull/2005/head v3.0.0rc17
Sébastien Han 2017-10-05 18:57:47 +02:00 committed by GitHub
commit 1121a840ef
5 changed files with 72 additions and 21 deletions

View File

@ -64,17 +64,6 @@
tags: tags:
- package-install - 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 - name: make sure monitor_interface or monitor_address is defined
fail: fail:
msg: "you must set monitor_interface or monitor_address" msg: "you must set monitor_interface or monitor_address"

View 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 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 return_content: yes
register: nfs_ganesha_apt_repo register: nfs_ganesha_apt_repo
when: when:
- nfs_group_name in group_names - nfs_group_name in group_names
- nfs_ganesha_dev - nfs_ganesha_dev
@ -27,7 +27,7 @@
owner: root owner: root
group: root group: root
backup: yes backup: yes
when: when:
- nfs_group_name in group_names - nfs_group_name in group_names
- nfs_ganesha_dev - nfs_ganesha_dev

View 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 - name: include prerequisite_rhcs_cdn_install_debian.yml
include: prerequisite_rhcs_cdn_install_debian.yml include: prerequisite_rhcs_cdn_install_debian.yml
when: when:

View File

@ -1,5 +1,5 @@
--- ---
- name: create red hat storage package directories - name: create red hat storage package directories for redhat systems
file: file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
@ -7,7 +7,7 @@
- "{{ ceph_rhcs_mount_path }}" - "{{ ceph_rhcs_mount_path }}"
- "{{ ceph_rhcs_repository_path }}" - "{{ ceph_rhcs_repository_path }}"
- name: ensure destination iso directory exists - name: ensure destination iso directory exists for redhat systems
file: file:
path: "{{ ceph_rhcs_iso_path | dirname }}" path: "{{ ceph_rhcs_iso_path | dirname }}"
state: directory state: directory
@ -15,14 +15,14 @@
when: when:
- ceph_rhcs_iso_path | dirname != '/' - 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: copy:
src: "{{ ceph_rhcs_iso_path }}" src: "{{ ceph_rhcs_iso_path }}"
dest: "{{ ceph_rhcs_iso_path }}" dest: "{{ ceph_rhcs_iso_path }}"
# assumption: ceph_rhcs_mount_path does not specify directory # 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: mount:
name: "{{ ceph_rhcs_mount_path }}" name: "{{ ceph_rhcs_mount_path }}"
src: "{{ ceph_rhcs_iso_path }}" src: "{{ ceph_rhcs_iso_path }}"
@ -31,24 +31,24 @@
passno: 2 passno: 2
state: mounted 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 }} shell: cp -r {{ ceph_rhcs_mount_path }}/* {{ ceph_rhcs_repository_path }}
args: args:
creates: "{{ ceph_rhcs_repository_path }}/README" creates: "{{ ceph_rhcs_repository_path }}/README"
- name: unmount red hat storage iso file - name: unmount red hat storage iso file for redhat systems
mount: mount:
name: "{{ ceph_rhcs_mount_path }}" name: "{{ ceph_rhcs_mount_path }}"
src: "{{ ceph_rhcs_iso_path }}" src: "{{ ceph_rhcs_iso_path }}"
fstype: iso9660 fstype: iso9660
state: unmounted state: unmounted
- name: install red hat storage repository key - name: install red hat storage repository key for redhat systems
rpm_key: rpm_key:
key: "{{ ceph_rhcs_repository_path }}/RPM-GPG-KEY-redhat-release" key: "{{ ceph_rhcs_repository_path }}/RPM-GPG-KEY-redhat-release"
state: present state: present
- name: add red hat storage repository - name: add red hat storage repository for redhat systems
template: template:
src: "{{ role_path }}/templates/redhat_storage_repo.j2" src: "{{ role_path }}/templates/redhat_storage_repo.j2"
dest: /etc/yum.repos.d/rh_storage.repo dest: /etc/yum.repos.d/rh_storage.repo

View File

@ -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