Can Puppet File Source be from a web service

httppuppetpuppet-dashboardpuppetmaster

Is there a (simple) way to have puppet use a file available on the internet for the Source property of a File?

eg:

file { "/home/text.txt":
  source => [
    "http://www.example.com/text.txt",
  ]
}

Best Answer

I'm writing an updated answer to notify future readers that now the File resource indeed implements the HTTP source.

From the docs:

source

A source file, which will be copied into place on the local system. This attribute is mutually exclusive with content and target. Allowed values are:

  • puppet: URIs, which point to files in modules or Puppet file server mount points.
  • Fully qualified paths to locally available files (including files on NFS shares or Windows mapped drives).
  • file: URIs, which behave the same as local file paths.
  • http: URIs, which point to files served by common web servers

So you can use the construct as you wrote it:

file { "/home/text.txt":
  source => "http://www.example.com/text.txt",
}
Related Topic