|
@@ -10,12 +10,8 @@
|
|
|
state: present
|
|
state: present
|
|
|
|
|
|
|
|
- name: the IQN is set for the initiator
|
|
- name: the IQN is set for the initiator
|
|
|
- template:
|
|
|
|
|
- src: templates/initiatorname.iscsi.j2
|
|
|
|
|
- dest: /etc/iscsi/initiatorname.iscsi
|
|
|
|
|
- owner: root
|
|
|
|
|
- group: root
|
|
|
|
|
- mode: 644
|
|
|
|
|
|
|
+ #FIXME: see "ansible-doc template" for some examples.
|
|
|
|
|
+ # Deploy the templates/initiatorname.iscsi.j2 template file
|
|
|
notify: restart iscsid
|
|
notify: restart iscsid
|
|
|
|
|
|
|
|
# Forces the handler to run so that the iscsid service is restarted
|
|
# Forces the handler to run so that the iscsid service is restarted
|
|
@@ -23,12 +19,10 @@
|
|
|
- meta: flush_handlers
|
|
- meta: flush_handlers
|
|
|
|
|
|
|
|
- name: the iSCSI target is discovered and available
|
|
- name: the iSCSI target is discovered and available
|
|
|
- open_iscsi:
|
|
|
|
|
- portal: 172.25.250.13
|
|
|
|
|
- port: 3260
|
|
|
|
|
- target: iqn.2014-06.com.example:serverd
|
|
|
|
|
- discover: yes
|
|
|
|
|
- login: yes
|
|
|
|
|
|
|
+ #FIXME: see "ansible-doc open_iscsi" for some examples.
|
|
|
|
|
+ # The target is iqn.2014-06.com.example:serverd and the portal is
|
|
|
|
|
+ # 172.25.250.13 (port 3260)
|
|
|
|
|
+ # Make sure that the target is automatically connected at startup.
|
|
|
register: target
|
|
register: target
|
|
|
|
|
|
|
|
- name: display the discovered devices
|
|
- name: display the discovered devices
|
|
@@ -45,9 +39,6 @@
|
|
|
type: disk
|
|
type: disk
|
|
|
disks:
|
|
disks:
|
|
|
- "{{ target['devicenodes'][0] }}"
|
|
- "{{ target['devicenodes'][0] }}"
|
|
|
- mount_point: /data
|
|
|
|
|
- fs_type: xfs
|
|
|
|
|
- mount_points: '_netdev'
|
|
|
|
|
#FIXME: see /usr/share/doc/rhel-system-roles/storage/README.md
|
|
#FIXME: see /usr/share/doc/rhel-system-roles/storage/README.md
|
|
|
# Set the mount point to /data, the file system type to xfs,
|
|
# Set the mount point to /data, the file system type to xfs,
|
|
|
# and add the _netdev mount option.
|
|
# and add the _netdev mount option.
|