ansible.builtin.open_iscsi (v2.7.16) — module

Manage iscsi targets with open-iscsi

| "added in version" 1.4 of ansible.builtin"

Authors: Serge van Ginderachter (@srvg)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.7.16

Description

Discover targets on given portal, (dis)connect targets, mark targets to manually or auto start, return device nodes of connected targets.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# description: discconnect from the cached named target
- open_iscsi:
    login: no
    target: 'iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d'

Inputs

    
port:
    default: 3260
    description:
    - the port on which the iscsi target process listens
    required: false

login:
    description:
    - whether the target node should be connected
    required: false
    type: bool

portal:
    aliases:
    - ip
    description:
    - the ip address of the iscsi target
    required: false

target:
    aliases:
    - name
    - targetname
    description:
    - the iscsi target name
    required: false

discover:
    description:
    - 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.
    required: false
    type: bool

node_auth:
    default: CHAP
    description:
    - discovery.sendtargets.auth.authmethod
    required: false

node_pass:
    description:
    - discovery.sendtargets.auth.password
    required: false

node_user:
    description:
    - discovery.sendtargets.auth.username
    required: false

show_nodes:
    description:
    - whether the list of nodes in the persistent iscsi database should be returned by
      the module
    required: false
    type: bool

auto_node_startup:
    aliases:
    - automatic
    description:
    - whether the target node should be automatically connected at startup
    required: false
    type: bool