--- - name: red hat based systems tasks when: ansible_os_family == 'RedHat' block: - name: set_fact common_pkgs set_fact: common_pkgs: - tcmu-runner - targetcli - name: set_fact base iscsi pkgs if new style ceph-iscsi set_fact: iscsi_base: - ceph-iscsi when: use_new_ceph_iscsi | bool - name: set_fact base iscsi pkgs if using older ceph-iscsi-config set_fact: iscsi_base: - ceph-iscsi-cli - ceph-iscsi-config when: not use_new_ceph_iscsi | bool - name: when ceph_iscsi_config_dev is true when: - ceph_origin == 'repository' - ceph_repository in ['dev', 'community'] - ceph_iscsi_config_dev | bool block: - name: get latest available build for tcmu-runner uri: url: "https://shaman.ceph.com/api/search/?status=ready&project=tcmu-runner&flavor=default&distros=centos/{{ ansible_facts['distribution_major_version'] }}/{{ ansible_facts['architecture'] }}&ref={{ ceph_dev_branch }}&sha1={{ ceph_dev_sha1 }}" return_content: yes run_once: true register: latest_build_tcmu_runner - name: fetch ceph red hat development repository for tcmu-runner uri: # Use the centos repo since we don't currently have a dedicated red hat repo url: "{{ (latest_build_tcmu_runner.content | from_json)[0]['chacra_url'] }}repo" return_content: yes register: ceph_dev_yum_repo_tcmu_runner - name: configure ceph red hat development repository for tcmu-runner copy: content: "{{ ceph_dev_yum_repo_tcmu_runner.content }}" dest: '/etc/yum.repos.d/tcmu-runner-dev.repo' owner: root group: root backup: yes - name: get latest available build for ceph-iscsi uri: url: "https://shaman.ceph.com/api/search/?status=ready&project={{ item }}&flavor=default&distros=centos/{{ ansible_facts['distribution_major_version'] }}/noarch&ref={{ ceph_dev_branch }}&sha1={{ ceph_dev_sha1 }}" return_content: yes run_once: true register: latest_build_ceph_iscsi with_items: "{{ iscsi_base }}" - name: fetch ceph red hat development repository for ceph-iscsi uri: # Use the centos repo since we don't currently have a dedicated red hat repo url: "{{ (item.content | from_json)[0]['chacra_url'] }}repo" return_content: yes register: ceph_dev_yum_repo_ceph_iscsi with_items: "{{ latest_build_ceph_iscsi.results }}" - name: configure ceph red hat development repository for tcmu-runner copy: content: "{{ item.content }}" dest: '/etc/yum.repos.d/{{ item.item.item }}-dev.repo' owner: root group: root backup: yes with_items: '{{ ceph_dev_yum_repo_ceph_iscsi.results }}' - name: ceph-iscsi stable repository get_url: url: 'https://download.ceph.com/ceph-iscsi/{{ "3" if use_new_ceph_iscsi | bool else "2" }}/rpm/el{{ ansible_distribution_major_version }}/ceph-iscsi.repo' dest: /etc/yum.repos.d/ceph-iscsi.repo force: true register: result until: result is succeeded when: ceph_repository == 'community' - name: install ceph iscsi package package: name: "{{ common_pkgs + iscsi_base }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" register: result until: result is succeeded - 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 # Only start tcmu-runner, so configure_iscsi.yml can create disks. # We must start rbd-target-gw/api after configure_iscsi.yml to avoid # races where they are both trying to setup the same object during # a rolling update. - name: start tcmu-runner service: name: tcmu-runner state: started enabled: yes masked: no