ceph-ansible/roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_insta...

58 lines
1.6 KiB
YAML
Raw Normal View History

---
- name: create red hat storage package directories for redhat systems
2015-09-04 00:18:53 +08:00
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ ceph_rhcs_mount_path }}"
- "{{ ceph_rhcs_repository_path }}"
- name: ensure destination iso directory exists for redhat 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 redhat systems
2015-09-04 00:18:53 +08:00
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 redhat systems
2015-09-04 00:18:53 +08:00
mount:
name: "{{ ceph_rhcs_mount_path }}"
src: "{{ ceph_rhcs_iso_path }}"
2015-09-04 00:18:53 +08:00
fstype: iso9660
opts: ro,loop,noauto
passno: 2
2015-09-04 00:18:53 +08:00
state: mounted
- name: copy red hat storage iso content for redhat systems
shell: cp -r {{ ceph_rhcs_mount_path }}/* {{ ceph_rhcs_repository_path }}
2015-09-04 00:18:53 +08:00
args:
creates: "{{ ceph_rhcs_repository_path }}/README"
- name: unmount red hat storage iso file for redhat systems
2015-09-04 00:18:53 +08:00
mount:
name: "{{ ceph_rhcs_mount_path }}"
src: "{{ ceph_rhcs_iso_path }}"
2015-09-04 00:18:53 +08:00
fstype: iso9660
state: unmounted
- 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 for redhat systems
template:
src: "{{ role_path }}/templates/redhat_storage_repo.j2"
dest: /etc/yum.repos.d/rh_storage.repo
owner: root
group: root
mode: 0644