switching from source => "puppet:/// to source => "file:///

18 views
Skip to first unread message

Locke Hajo

unread,
Jun 13, 2019, 11:28:22 AM6/13/19
to Puppet Users
Hello List,

do my first steps with puppet an currently i have a working configuration.

In my test i sync a file /etc/apache2/conf.d/testpuppet.conf to the node using this:

file { "/etc/apache2/conf.d/testpuppet.conf":
owner => root,
group => root,
mode => "644",
source => "puppet:///modules/apache2/apache2/conf.d/testpuppet.conf",
  }

This is working but it took a while to find where puppet:///modules/apache2/apache2/conf.d/testpuppet.conf is really located on filesystem.

Now i want to change the sourcetype from puppet:// to file:// described here:

I do this because i want to sync the real file otherwise i had to copy file on each change.

New source is this:

source => "file:///etc/apache2/conf.d/testpuppet.conf",

Unfortunately on node now i get this error:

Error: /Stage[main]/Apache2/File[/etc/apache2/conf.d/testpuppet.conf]: Could not evaluate: Could not retrieve information from environment production source(s) file:///etc/apache2/conf.d/testpuppet.conf
Notice: /Stage[main]/Apache2/Service[apache2]: Dependency File[/etc/apache2/conf.d/testpuppet.conf] has failures: true
Warning: /Stage[main]/Apache2/Service[apache2]: Skipping because of failed dependencies


Whats wrong here? Path is correct and file existent, why cant be synced from filesystem directly in this case?

Thanks,
Hajo

Ben Ford

unread,
Jun 13, 2019, 2:09:38 PM6/13/19
to puppet...@googlegroups.com
I suspect that you're misunderstanding something about how Puppet works, because as far as I can tell, you're trying to copy /etc/apache2/conf.d/testpuppet.conf to /etc/apache2/conf.d/testpuppet.conf. (The same path)

It's relatively rare to use anything but a puppet:// URI in a file source attribute.

I suggest running through the learning VM to get a quick taste of how the system works. https://learn.puppet.com


Sent from my iPhone

> On Jun 13, 2019, at 4:29 AM, Locke Hajo <hajo....@gmail.com> wrote:
>
> /etc/apache2/conf.d/testpuppet.conf

Locke Hajo

unread,
Jun 14, 2019, 3:45:09 AM6/14/19
to Puppet Users
Hello,


I suspect that you're misunderstanding something about how Puppet works, because as far as I can tell, you're trying to copy /etc/apache2/conf.d/testpuppet.conf to /etc/apache2/conf.d/testpuppet.conf. (The same path)

yes i want to mirror a file from the master to my client. For me it seems to bo the best way to mirror original files and changes.
Otherwise i would need a further machine as a master and put changes into puppet:/// structur.

For type file source attribut can have values puppet: , file: and http:
description for file is: file: URIs, which behave the same as local file paths.
Why is it offered, if it should not be used? Do i understand something wrong?

Thanks,
Hajo

David Schmitt

unread,
Jun 14, 2019, 3:49:00 AM6/14/19
to Puppet Users
`file:///` sources are local to the *agent*, not the *puppetserver*. Puppet's philosophy is to manage nodes based on a controlled source base (the control repo), not mirroring from a live machine. If you want to have a guided tour of the what and how, please follow Ben's recommendation of trying out the learning VM at https://learn.puppet.com


Cheers, David
 

Thanks,
Hajo

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/100af972-b436-4bc9-8c2c-92fc1f96c822%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Locke Hajo

unread,
Jun 14, 2019, 5:31:41 AM6/14/19
to Puppet Users
Hello,



`file:///` sources are local to the *agent*, not the *puppetserver*

ahh, thanks, that was the missing info. did not found this in docs.

Thanks,
Hajo
Reply all
Reply to author
Forward
0 new messages