open_iscsi - Manage iscsi targets with open-iscsi

New in version 1.4.

Synopsis

Requirements

The below requirements are needed on the host that executes this module.

  • open_iscsi library and tools (iscsiadm)

Parameters

Parameter Choices/Defaults Comments
auto_node_startup
bool
    Choices:
  • no
  • yes
whether the target node should be automatically connected at startup

aliases: automatic
discover
bool
    Choices:
  • no
  • yes
whether the list of target nodes on the portal should be (re)discovered and added to the persistent iscsi database. Keep in mind that iscsiadm discovery resets configurtion, like node.startup to manual, hence combined with auto_node_startup=yes will always return a changed state.
login
bool
    Choices:
  • no
  • yes
whether the target node should be connected
node_auth Default:
CHAP
discovery.sendtargets.auth.authmethod
node_pass
discovery.sendtargets.auth.password
node_user
discovery.sendtargets.auth.username
port Default:
3260
the port on which the iscsi target process listens
portal
the ip address of the iscsi target

aliases: ip
show_nodes
bool
    Choices:
  • no
  • yes
whether the list of nodes in the persistent iscsi database should be returned by the module
target
the iscsi target name

aliases: name, targetname

Examples

# perform a discovery on 10.1.2.3 and show available target nodes
- open_iscsi:
    show_nodes: yes
    discover: yes
    portal: 10.1.2.3

# discover targets on portal and login to the one available
# (only works if exactly one target is exported to the initiator)
- open_iscsi:
    portal: '{{ iscsi_target }}'
    login: yes
    discover: yes

# description: connect to the named target, after updating the local
# persistent database (cache)
- open_iscsi:
    login: yes
    target: 'iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d'

# description: discconnect from the cached named target
- open_iscsi:
    login: no
    target: 'iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d'

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance

This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.

For a list of other modules that are also maintained by the Ansible Community, see here.

Author

  • Serge van Ginderachter (@srvg)

Hint

If you notice any issues in this documentation you can edit this document to improve it.