Skip to content
Browse files

Added 'hostname' dep.

  • Loading branch information...
1 parent 82b14b4 commit 222d958649dc08f4a60f33134eb23b9d795f4f05 @benhoskings benhoskings committed Jun 30, 2009
Showing with 19 additions and 1 deletion.
  1. +19 −1 system.rb
View
20 system.rb
@@ -1,11 +1,29 @@
dep 'system' do
- requires 'secured ssh logins', 'lax host key checking', 'admins can sudo'
+ requires 'hostname', 'secured ssh logins', 'lax host key checking', 'admins can sudo'
end
def ssh_conf_path file
"/etc#{'/ssh' if linux?}/#{file}_config"
end
+dep 'hostname' do
+ met? {
+ if osx?
+ true
+ else
+ current_hostname = shell('hostname -f')
+ stored_hostname = read_file('/etc/hostname')
+ !stored_hostname.blank? && current_hostname == stored_hostname
+ end
+ }
+ meet {
+ if linux?
+ sudo "cat #{hostname shell('hostname')} > /etc/hostname"
+ sudo "/etc/init.d/hostname.sh"
+ end
+ }
+end
+
dep 'secured ssh logins' do
requires 'sed'
met? {

0 comments on commit 222d958

Please sign in to comment.
Something went wrong with that request. Please try again.