Skip to content

Instantly share code, notes, and snippets.

@turingmachine
Created December 10, 2009 17:05
Show Gist options
  • Save turingmachine/253479 to your computer and use it in GitHub Desktop.
Save turingmachine/253479 to your computer and use it in GitHub Desktop.
[root@host ~]# test `ls -1 /dev/iscsi* | wc -l` -eq 0
[root@host ~]# echo $?
1
class iscsi
...
file{'/etc/iscsi/iscsid.conf':
content => template('iscsi/iscsid.conf.erb'),
require => Package['iscsi-initiator-utils'],
notify => [
Exec[update_iscsi_database],
Exec[restart_iscsi_daemon_before_discovery],
Exec[discover_iscsi_targets],
],
owner => root, group => 0, mode => 0600;
}
exec{'restart_iscsi_daemon_before_discovery':
refreshonly => true,
before => Exec[discover_iscsi_targets],
onlyif => "test `ls -1 /dev/iscsi* | wc -l` -eq 0",
command => "/etc/init.d/iscsi restart; /bin/true",
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment