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)


29
30
31
# File 'lib/chef/sugar/platform_family.rb', line 29

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)


41
42
43
# File 'lib/chef/sugar/platform_family.rb', line 41

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)


52
53
54
# File 'lib/chef/sugar/platform_family.rb', line 52

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)


63
64
65
# File 'lib/chef/sugar/platform_family.rb', line 63

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)


74
75
76
# File 'lib/chef/sugar/platform_family.rb', line 74

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

#linux?(node) ⇒ Boolean

Determine if the current system is a linux derivative

Parameters:

Returns:

  • (Boolean)


154
155
156
157
158
159
160
161
162
163
164
# File 'lib/chef/sugar/platform_family.rb', line 154

def linux?(node)
  %w(
    arch
    debian
    fedora
    gentoo
    rhel
    slackware
    suse
  ).include?(node['platform_family'])
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)


85
86
87
# File 'lib/chef/sugar/platform_family.rb', line 85

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)


98
99
100
# File 'lib/chef/sugar/platform_family.rb', line 98

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

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

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

Parameters:

Returns:

  • (Boolean)


109
110
111
# File 'lib/chef/sugar/platform_family.rb', line 109

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)


121
122
123
# File 'lib/chef/sugar/platform_family.rb', line 121

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)


132
133
134
# File 'lib/chef/sugar/platform_family.rb', line 132

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)


143
144
145
# File 'lib/chef/sugar/platform_family.rb', line 143

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