2015-07-03 00:23:11 +08:00
|
|
|
---
|
|
|
|
- name: create red hat storage package directories
|
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
|
|
|
|
|
|
|
- name: ensure destination iso directory exists
|
|
|
|
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
|
2016-08-12 23:31:01 +08:00
|
|
|
when: "'{{ ceph_rhcs_iso_path | dirname }}' != '/'"
|
2015-07-03 00:23:11 +08:00
|
|
|
|
|
|
|
- name: fetch the red hat storage iso from the ansible server
|
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
|
|
|
|
2015-07-03 00:23:11 +08:00
|
|
|
- name: mount red hat storage iso file
|
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
|
|
|
|
|
|
|
- name: copy red hat storage iso content
|
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:
|
2016-08-12 23:31:01 +08:00
|
|
|
creates: "{{ ceph_rhcs_repository_path }}/README"
|
2015-07-03 00:23:11 +08:00
|
|
|
|
2016-02-10 04:02:55 +08:00
|
|
|
- name: unmount red hat storage iso file
|
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
|
|
|
|
|
|
|
- name: install the red hat ceph storage repository key
|
|
|
|
apt_key:
|
|
|
|
file: "{{ ceph_rhcs_repository_path }}/MON/release.asc"
|
|
|
|
state: present
|
|
|
|
when: ceph_rhcs_iso_install
|
|
|
|
|
|
|
|
- name: add red hat ceph storage repositories
|
|
|
|
apt_repository:
|
|
|
|
repo: "deb file://{{ ceph_rhcs_repository_path }}/{{ item }}/ {{ ansible_lsb.codename }} main"
|
|
|
|
state: present
|
|
|
|
changed_when: false
|
|
|
|
with_items:
|
|
|
|
- "MON"
|
|
|
|
- "OSD"
|
|
|
|
- "Tools"
|
|
|
|
- "Agent"
|
|
|
|
when: ceph_rhcs_iso_install
|
|
|
|
|