diff --git a/iscsi/manifests/init.pp b/iscsi/manifests/init.pp index 0e40050..d826a2e 100644 --- a/iscsi/manifests/init.pp +++ b/iscsi/manifests/init.pp @@ -1,4 +1,6 @@ +# Install iSCSI target prequisites. +# class iscsi::server { package { "scsi-target-utils": @@ -40,6 +42,31 @@ class iscsi::server { } +# Create iSCSI target. +# +# === Parameters +# +# $name: +# Path to block device that will be used as target. +# +# $tid: +# Target ID. +# +# $initiator: +# List of hosts that are allowed to connect to this target. +# Defaults to ALL. +# +# $ensure: +# If set to present target will be created and if set to absent +# target will be removed. +# +# === Sample usage +# +# iscsi::target { "/dev/vg0/iscsi": +# ensure => present, +# tid => 1, +# initiator => "192.168.1.2", +# } define iscsi::target($tid, $initiator = "ALL", $ensure = "present") { include iscsi::server @@ -70,6 +97,8 @@ define iscsi::target($tid, $initiator = "ALL", $ensure = "present") { } +# Install iSCSI initiator software. +# class iscsi::initiator { package { "iscsi-initiator-utils": @@ -84,6 +113,21 @@ class iscsi::initiator { } +# Connect to iSCSI target. +# +# === Parameters +# +# $name: +# IQN of iSCSI target to connect to. +# +# $portal: +# Address of iSCSI target server. +# +# === Sample usage +# +# iscsi::connect { "iqn.2005-08.tgt:vm0001.dev.vg0.iscsi": +# portal => "192.168.100.1", +# } define iscsi::connect($portal) { include iscsi::initiator @@ -95,4 +139,4 @@ define iscsi::connect($portal) { require => Service["iscsid"], } -} \ No newline at end of file +}