Not able for find any information for windows on Ansible Module to create the iSCSI initiator.
Could you please provide a sample playbook to configure the ISCSI initiator on Microsoft Windows Server 2019 Edition.
Not able for find any information for windows on Ansible Module to create the iSCSI initiator.
Could you please provide a sample playbook to configure the ISCSI initiator on Microsoft Windows Server 2019 Edition.
I know this post is older but you can utilize the anisble.windows.win_ps_module, ansible.windows.win_service, and ansible.windows.win_dsc modules to build a role.
Example:
---
- name: Add the iSCSIdsc module
community.windows.win_psmodule:
name: iSCSIdsc
state: present
accept_license: true
- name: Start the iSCSI initiator on server
ansible.windows.win_service:
name: MSiSCSI
start_mode: auto
state: started
- name: Attach the disks to the server
ansible.windows.win_dsc:
resource_name: iSCSIInitiator
ensure: present
IsPersistent: true
NodeAddress: "iqn.1991-05.com.microsoft:{{ node_address }}"
TargetPortalAddress: "{{ storage_server_fqdn }}"