Add a iscsi_client role, add to virthosts
This commit is contained in:
parent
99c56cb70d
commit
5fe0dc0037
5 changed files with 112 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
- name: make virthost server system
|
||||
hosts: $target
|
||||
user: root
|
||||
accelerate: True
|
||||
gather_facts: True
|
||||
|
||||
vars_files:
|
||||
|
@ -18,6 +19,7 @@
|
|||
- /srv/web/infra/ansible/roles/denyhosts
|
||||
- /srv/web/infra/ansible/roles/nagios_client
|
||||
- /srv/web/infra/ansible/roles/fas_client
|
||||
- /srv/web/infra/ansible/roles/iscsi_client
|
||||
|
||||
tasks:
|
||||
- include: $tasks/hosts.yml
|
||||
|
|
65
roles/iscsi_client/files/multipath.conf
Normal file
65
roles/iscsi_client/files/multipath.conf
Normal file
|
@ -0,0 +1,65 @@
|
|||
defaults {
|
||||
rr_min_io 128
|
||||
user_friendly_names yes
|
||||
max_fds max
|
||||
queue_without_daemon no
|
||||
}
|
||||
|
||||
blacklist {
|
||||
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
|
||||
devnode "^hd[a-z]"
|
||||
devnode "^cciss!c[0-9]d[0-9]*"
|
||||
device {
|
||||
vendor "IBM-ESXS"
|
||||
}
|
||||
device {
|
||||
vendor "IBM"
|
||||
}
|
||||
device {
|
||||
vendor "LSILOGIC"
|
||||
}
|
||||
device {
|
||||
vendor "ATA"
|
||||
}
|
||||
device {
|
||||
vendor "VMware"
|
||||
}
|
||||
|
||||
wwid "*GBRL0015XVEUCM*" # Blacklist the on board blade RAID controller
|
||||
}
|
||||
|
||||
devices {
|
||||
device {
|
||||
vendor "NETAPP"
|
||||
product "LUN"
|
||||
path_grouping_policy group_by_prio
|
||||
path_checker directio
|
||||
failback immediate
|
||||
prio ontap
|
||||
features "1 queue_if_no_path"
|
||||
}
|
||||
|
||||
device {
|
||||
path_checker tur
|
||||
product "NEXTRA"
|
||||
vendor "XIV"
|
||||
rr_min_io 15
|
||||
path_grouping_policy multibus
|
||||
path_selector "round-robin 0"
|
||||
no_path_retry 5
|
||||
polling_interval 3
|
||||
failback 15
|
||||
}
|
||||
|
||||
device {
|
||||
path_checker tur
|
||||
product "2810XIV"
|
||||
vendor "IBM"
|
||||
rr_min_io 15
|
||||
path_grouping_policy multibus
|
||||
path_selector "round-robin 0"
|
||||
no_path_retry 5
|
||||
polling_interval 3
|
||||
failback 15
|
||||
}
|
||||
}
|
39
roles/iscsi_client/tasks/main.yml
Normal file
39
roles/iscsi_client/tasks/main.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
#
|
||||
# This task sets up iscsid and mpathd on a machine.
|
||||
#
|
||||
|
||||
#
|
||||
- name: install packages needed for iscsi_client
|
||||
yum: state=installed name=$item
|
||||
with_items:
|
||||
- iscsi-initiator-utils
|
||||
- device-mapper-multipath
|
||||
tags:
|
||||
- packages
|
||||
|
||||
- name: enable iscsi service
|
||||
service: state=running enabled=yes name=iscsi
|
||||
tags:
|
||||
- services
|
||||
|
||||
- name: enable multipathd service
|
||||
service: state=running enabled=yes name=multipathd
|
||||
tags:
|
||||
- services
|
||||
|
||||
- name: setup multipath.conf file
|
||||
copy: src=multipath.conf dest=/etc/multipath.conf
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: setup initiatorname.iscsi
|
||||
template: src=initiatorname.iscsi.j2 dest=/etc/iscsi/initiatorname.iscsi
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: run iscsiadm command for initial connect
|
||||
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
|
||||
|
1
roles/iscsi_client/templates/initiatorname.iscsi.j2
Normal file
1
roles/iscsi_client/templates/initiatorname.iscsi.j2
Normal file
|
@ -0,0 +1 @@
|
|||
InitiatorName=iqn.2003-11.org.fedoraproject.{{ inventory_hostname }}
|
|
@ -21,3 +21,8 @@ global_pkgs_inst: ['bind-utils', 'joe', 'mailx', 'nc', 'openssh-clients',
|
|||
'patch', 'postfix', 'rsync', 'strace', 'telnet',
|
||||
'tmpwatch', 'traceroute', 'vim-enhanced', 'xz', 'zsh',
|
||||
'libselinux-python' ]
|
||||
|
||||
# iscsi initiator for netapp iscsi volume
|
||||
netapp_iscsi_name: iqn.1992-08.com.netapp:sn.1573980081:vf.6fb258f4-106f-11e2-ae29-00a098161d90
|
||||
# iscsi portal for netapp iscsi volume
|
||||
netapp_iscsi_portal: 10.5.88.35
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue