ceph-ansible/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml

74 lines
2.1 KiB
YAML
Raw Normal View History

---
- name: red hat based systems tasks
block:
- name: when ceph_iscsi_config_dev is true
block:
- name: set_fact ceph_iscsi_repos
set_fact:
ceph_iscsi_repos:
- ceph-iscsi-config
- tcmu-runner
- python-rtslib
- ceph-iscsi-cli
- name: fetch ceph-iscsi-config development repository
uri:
url: https://shaman.ceph.com/api/repos/{{ item }}/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo
return_content: yes
register: ceph_iscsi_config_dev_yum_repo
with_items: "{{ ceph_iscsi_repos }}"
- name: configure ceph-iscsi-config development repository
copy:
content: "{{ item.0.content }}"
dest: "/etc/yum.repos.d/{{ item.1 }}-dev.repo"
owner: root
group: root
backup: yes
with_together:
- "{{ ceph_iscsi_config_dev_yum_repo.results }}"
- "{{ ceph_iscsi_repos }}"
when:
- ceph_origin == 'repository'
- ceph_repository == 'dev'
- ceph_iscsi_config_dev
- name: install ceph iscsi package
package:
name: "{{ item }}"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
with_items:
- tcmu-runner
- ceph-iscsi-config
- targetcli
- python-rtslib
- ceph-iscsi-cli
when:
- ansible_os_family == 'RedHat'
- name: check the status of the target.service override
stat:
path: /etc/systemd/system/target.service
register: target
- name: mask the target service - preventing manual start
systemd:
name: target
masked: yes
enabled: no
when:
- target.stat.exists
- not target.stat.islnk
- name: enable the rbd-target-gw service and make sure it is running
service:
name: rbd-target-gw
enabled: yes
state: started
- name: enable the rbd-target-api service and make sure it is running
service:
name: rbd-target-api
enabled: yes
state: started