mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-01 05:51:56 +08:00
Replaces references to template: with ansible.builtin.template Signed-off-by: Ryan Lerch <rlerch@redhat.com>
78 lines
3.1 KiB
YAML
78 lines
3.1 KiB
YAML
---
|
|
#
|
|
# This task sets up iscsid and mpathd on a machine.
|
|
#
|
|
#
|
|
- name: Install packages needed for iscsi_client (yum)
|
|
ansible.builtin.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)
|
|
ansible.builtin.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)
|
|
ansible.builtin.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
|
|
ansible.builtin.copy: src=multipath.conf dest=/etc/multipath.conf
|
|
tags:
|
|
- config
|
|
|
|
- name: Setup initiatorname.iscsi
|
|
ansible.builtin.template: src=initiatorname.iscsi.j2 dest=/etc/iscsi/initiatorname.iscsi
|
|
tags:
|
|
- config
|
|
|
|
- name: Set up iscsi interface for EL8
|
|
ansible.builtin.command: creates=/var/lib/iscsi/ifaces/{{ netapp_iscsi_interface_iad2 }} iscsiadm -m iface -I {{ netapp_iscsi_interface_iad2 }} --op=new
|
|
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == "RedHat" and datacenter == 'iad2'
|
|
tags:
|
|
- config
|
|
|
|
- name: Run iscsiadm command for initial connect to PHX2 vtap-fedora-iscsi01
|
|
ansible.builtin.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 IAD2 vtap-fedora-iscsi01
|
|
ansible.builtin.command: creates=/var/lib/iscsi/nodes/{{ netapp_iscsi_name_iad2 }}/{{ netapp_iscsi_portal_iad2 }},3260 /sbin/iscsiadm --mode node --targetname --portal {{ netapp_iscsi_portal_iad2 }} -o new ; /sbin/iscsiadm --mode node --targetname {{ netapp_iscsi_name_iad2 }} --portal {{ netapp_iscsi_portal_iad2 }} --login
|
|
when: ansible_distribution_major_version|int >= 8 and ansible_distribution == "RedHat" and datacenter == 'iad2'
|
|
tags:
|
|
- config
|
|
|
|
# - name: Run iscsiadm command for initial connect to vtap-fedora-nfs01
|
|
# ansible.builtin.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"
|