Module: Chef::Sugar::PlatformFamily

Extended by:
PlatformFamily
Included in:
PlatformFamily
Defined in:
lib/chef/sugar/platform_family.rb

Instance Method Summary collapse

Instance Method Details

#arch_linux?(node) ⇒ Boolean Also known as: arch?

Determine if the current node is a member of the arch family.

Parameters:

Returns:

  • (Boolean)


32
33
34
# File 'lib/chef/sugar/platform_family.rb', line 32

def arch_linux?(node)
  node['platform_family'] == 'arch'
end

#debian?(node) ⇒ Boolean

Determine if the current node is a member of the debian family.

Parameters:

Returns:

  • (Boolean)


44
45
46
# File 'lib/chef/sugar/platform_family.rb', line 44

def debian?(node)
  node['platform_family'] == 'debian'
end

#fedora?(node) ⇒ Boolean

Determine if the current node is a member of the fedora family.

Parameters:

Returns:

  • (Boolean)


55
56
57
# File 'lib/chef/sugar/platform_family.rb', line 55

def fedora?(node)
  node['platform_family'] == 'fedora'
end

#freebsd?(node) ⇒ Boolean

Determine if the current node is a member of the freebsd family.

Parameters:

Returns:

  • (Boolean)


66
67
68
# File 'lib/chef/sugar/platform_family.rb', line 66

def freebsd?(node)
  node['platform_family'] == 'freebsd'
end

#gentoo?(node) ⇒ Boolean

Determine if the current node is a member of the arch family.

Parameters:

Returns:

  • (Boolean)


77
78
79
# File 'lib/chef/sugar/platform_family.rb', line 77

def gentoo?(node)
  node['platform_family'] == 'gentoo'
end

#linux?(node) ⇒ Boolean

Determine if the current system is a linux derivative

Parameters:

Returns:

  • (Boolean)


169
170
171
# File 'lib/chef/sugar/platform_family.rb', line 169

def linux?(node)
  node['os'] == 'linux'
end

#mac_os_x?(node) ⇒ Boolean Also known as: osx?, mac?

Determine if the current node is a member of the OSX family.

Parameters:

Returns:

  • (Boolean)


88
89
90
# File 'lib/chef/sugar/platform_family.rb', line 88

def mac_os_x?(node)
  node['platform_family'] == 'mac_os_x'
end

#openbsd?(node) ⇒ Boolean

Determine if the current node is a member of the openbsd family.

Parameters:

Returns:

  • (Boolean)


101
102
103
# File 'lib/chef/sugar/platform_family.rb', line 101

def openbsd?(node)
  node['platform_family'] == 'openbsd'
end

#rhel?(node) ⇒ Boolean Also known as: redhat?, el?

Determine if the current node is a member of the redhat family.

Parameters:

Returns:

  • (Boolean)


112
113
114
# File 'lib/chef/sugar/platform_family.rb', line 112

def rhel?(node)
  node['platform_family'] == 'rhel'
end

#slackware?(node) ⇒ Boolean

Determine if the current node is a member of the slackware family.

Parameters:

Returns:

  • (Boolean)


125
126
127
# File 'lib/chef/sugar/platform_family.rb', line 125

def slackware?(node)
  node['platform_family'] == 'slackware'
end

#suse?(node) ⇒ Boolean

Determine if the current node is a member of the suse family.

Parameters:

Returns:

  • (Boolean)


136
137
138
# File 'lib/chef/sugar/platform_family.rb', line 136

def suse?(node)
  node['platform_family'] == 'suse'
end

#windows?(node) ⇒ Boolean

Determine if the current node is a member of the windows family.

Parameters:

Returns:

  • (Boolean)


147
148
149
# File 'lib/chef/sugar/platform_family.rb', line 147

def windows?(node)
  node['platform_family'] == 'windows'
end

#wrlinux?(node) ⇒ Boolean

Determine if the current node is a member of the wrlinux family.

Parameters:

Returns:

  • (Boolean)


158
159
160
# File 'lib/chef/sugar/platform_family.rb', line 158

def wrlinux?(node)
  node['platform_family'] == 'wrlinux'
end