"lib/puppet/dotfiles/lib/lib/puppet/dotfiles/lib/facter" did not exist on "1042df79ab6e547769d2f35b7f58142943690f3c"
profile.rb 473 Bytes
Newer Older
James T. Lee's avatar
James T. Lee committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Facter.add('profile') do
  confine :osfamily => 'Gentoo'
  setcode do
    profile = Facter::Core::Execution.execute('/usr/bin/eselect --brief profile show')
    case profile
    when %r{nest:(\S+)/(\S+)/(\S+)}
      { :cpu => $1, :platform => $2, :role => $3 }
    when %r{nest:(\S+)/(\S+)}
      { :cpu => $1, :platform => $1, :role => $2 }
    end
  end
end

Facter.add('profile') do
  confine :osfamily => 'windows'
  setcode do
    { :role => 'workstation' }
  end
end