mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-02-02 20:59:02 +08:00
66 lines
2.2 KiB
YAML
66 lines
2.2 KiB
YAML
---
|
|
#
|
|
# This task sets up iscsid and mpathd on a machine.
|
|
#
|
|
#
|
|
- name: install packages needed for iscsi_client (yum)
|
|
package:
|
|
state: present
|
|
name:
|
|
- iscsi-initiator-utils
|
|
- device-mapper-multipath
|
|
tags:
|
|
- packages
|
|
when: ansible_distribution_major_version|int < 8 and ansible_distribution == "RedHat"
|
|
|
|
- name: install packages needed for iscsi_client (dnf)
|
|
package:
|
|
state: present
|
|
name:
|
|
- iscsi-initiator-utils
|
|
- device-mapper-multipath
|
|
tags:
|
|
- packages
|
|
when: ansible_distribution_major_version|int >= 29 and ansible_distribution == "Fedora" and ansible_cmdline.ostree is not defined
|
|
|
|
- name: install packages needed for iscsi_client (dnf)
|
|
package:
|
|
state: present
|
|
name:
|
|
- iscsi-initiator-utils
|
|
- device-mapper-multipath
|
|
tags:
|
|
- packages
|
|
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == "RedHat" and ansible_cmdline.ostree is not defined
|
|
|
|
- name: enable iscsi service
|
|
service: state=started enabled=yes name=iscsi
|
|
tags:
|
|
- services
|
|
|
|
- name: enable multipathd service
|
|
service: state=started enabled=yes name=multipathd
|
|
tags:
|
|
- services
|
|
|
|
- name: setup multipath.conf file
|
|
copy: src=multipath.conf dest=/etc/multipath.conf
|
|
tags:
|
|
- config
|
|
|
|
- name: setup initiatorname.iscsi
|
|
template: src=initiatorname.iscsi.j2 dest=/etc/iscsi/initiatorname.iscsi
|
|
tags:
|
|
- config
|
|
|
|
- name: run iscsiadm command for initial connect to vtap-fedora-iscsi01
|
|
command: creates=/var/lib/iscsi/nodes/{{ netapp_iscsi_name }}/{{ netapp_iscsi_portal }},3260 /sbin/iscsiadm --mode node --targetname --portal {{ netapp_iscsi_portal }} -o new ; /sbin/iscsiadm --mode node --targetname {{ netapp_iscsi_name }} --portal {{ netapp_iscsi_portal }} --login
|
|
tags:
|
|
- config
|
|
|
|
#- name: run iscsiadm command for initial connect to vtap-fedora-nfs01
|
|
# command: creates=/var/lib/iscsi/nodes/{{ netapp_nfs01_iscsi_name }}/{{ netapp_nfs01_iscsi_portal }},3260 /sbin/iscsiadm --mode node --targetname --portal {{ netapp_nfs01_iscsi_portal }} -o new ; /sbin/iscsiadm --mode node --targetname {{ netapp_nfs01_iscsi_name }} --portal {{ netapp_nfs01_iscsi_portal }} --login
|
|
# tags:
|
|
# - config
|
|
# when: inventory_hostname_short == "buildvmhost-10"
|