2015-07-03 00:23:11 +08:00
|
|
|
---
|
2017-10-06 00:33:17 +08:00
|
|
|
- name: create red hat storage package directories for redhat systems
|
2015-09-04 00:18:53 +08:00
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
2015-07-03 00:23:11 +08:00
|
|
|
with_items:
|
2016-08-12 23:31:01 +08:00
|
|
|
- "{{ ceph_rhcs_mount_path }}"
|
|
|
|
- "{{ ceph_rhcs_repository_path }}"
|
2016-07-12 21:59:27 +08:00
|
|
|
|
2017-10-06 00:33:17 +08:00
|
|
|
- name: ensure destination iso directory exists for redhat systems
|
2016-07-12 21:59:27 +08:00
|
|
|
file:
|
2016-08-12 23:31:01 +08:00
|
|
|
path: "{{ ceph_rhcs_iso_path | dirname }}"
|
2016-07-12 21:59:27 +08:00
|
|
|
state: directory
|
|
|
|
recurse: yes
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ceph_rhcs_iso_path | dirname != '/'
|
2015-07-03 00:23:11 +08:00
|
|
|
|
2017-10-06 00:33:17 +08:00
|
|
|
- name: fetch the red hat storage iso from the ansible server for redhat systems
|
2015-09-04 00:18:53 +08:00
|
|
|
copy:
|
2016-08-12 23:31:01 +08:00
|
|
|
src: "{{ ceph_rhcs_iso_path }}"
|
|
|
|
dest: "{{ ceph_rhcs_iso_path }}"
|
2015-07-03 00:23:11 +08:00
|
|
|
|
2016-08-12 23:31:01 +08:00
|
|
|
# assumption: ceph_rhcs_mount_path does not specify directory
|
2016-02-10 04:02:55 +08:00
|
|
|
|
2017-10-06 00:33:17 +08:00
|
|
|
- name: mount red hat storage iso file for redhat systems
|
2015-09-04 00:18:53 +08:00
|
|
|
mount:
|
2016-08-12 23:31:01 +08:00
|
|
|
name: "{{ ceph_rhcs_mount_path }}"
|
|
|
|
src: "{{ ceph_rhcs_iso_path }}"
|
2015-09-04 00:18:53 +08:00
|
|
|
fstype: iso9660
|
2016-02-10 04:02:55 +08:00
|
|
|
opts: ro,loop,noauto
|
|
|
|
passno: 2
|
2015-09-04 00:18:53 +08:00
|
|
|
state: mounted
|
2015-07-03 00:23:11 +08:00
|
|
|
|
2017-10-06 00:33:17 +08:00
|
|
|
- name: copy red hat storage iso content for redhat systems
|
2016-08-12 23:31:01 +08:00
|
|
|
shell: cp -r {{ ceph_rhcs_mount_path }}/* {{ ceph_rhcs_repository_path }}
|
2015-09-04 00:18:53 +08:00
|
|
|
args:
|
2018-05-03 22:54:53 +08:00
|
|
|
creates: "{{ ceph_rhcs_repository_path+'/README' if not rolling_update else 'dummy' }}"
|
2015-07-03 00:23:11 +08:00
|
|
|
|
2017-10-06 00:33:17 +08:00
|
|
|
- name: unmount red hat storage iso file for redhat systems
|
2015-09-04 00:18:53 +08:00
|
|
|
mount:
|
2016-08-12 23:31:01 +08:00
|
|
|
name: "{{ ceph_rhcs_mount_path }}"
|
|
|
|
src: "{{ ceph_rhcs_iso_path }}"
|
2015-09-04 00:18:53 +08:00
|
|
|
fstype: iso9660
|
2016-02-24 05:43:45 +08:00
|
|
|
state: unmounted
|
2017-08-02 21:13:06 +08:00
|
|
|
|
2017-10-06 00:33:17 +08:00
|
|
|
- name: install red hat storage repository key for redhat systems
|
2017-08-03 21:30:25 +08:00
|
|
|
rpm_key:
|
|
|
|
key: "{{ ceph_rhcs_repository_path }}/RPM-GPG-KEY-redhat-release"
|
2017-08-02 21:13:06 +08:00
|
|
|
state: present
|
2018-12-20 17:00:26 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-08-02 21:13:06 +08:00
|
|
|
|
2017-10-06 00:33:17 +08:00
|
|
|
- name: add red hat storage repository for redhat systems
|
2017-08-03 21:30:25 +08:00
|
|
|
template:
|
|
|
|
src: "{{ role_path }}/templates/redhat_storage_repo.j2"
|
|
|
|
dest: /etc/yum.repos.d/rh_storage.repo
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|