Defined Type: fetchfact::fetch

Defined in:
manifests/fetch.pp

Overview

Parameters:

  • url (Any)
  • factfile (Any)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'manifests/fetch.pp', line 1

define fetchfact::fetch ( $url, $factfile ) {

  include fetchfact
  $path = "/etc/facter/facts.d/$factfile"

  case $factfile {
    /.*\.json$/: {
      case $osfamily {
        'redhat','debian','suse': {
           package { "ruby-json":
             ensure => installed
           }
        }
        default: {
           package { "json":
             ensure => installed,
             provider => gem
           }
        }
      }
    }
    default: {
      # nothing to do -- YAML and .txt support
      # relies on no external packages
    }
  }


  wget::fetch { "$url":
    source => $url,
    destination => $path,
    require => File['/etc/facter/facts.d']
  }

}