Re: [Puppet Users] File content misrecognised as checksum

2022-01-12 Thread Iain Hallam
The Puppet code is looping through dozens of domains, creating resources 
for each, so downloading won't work unless I create some service that can 
craft the right file from parameters in the URL. I've gone with the hack I 
suggested above for now, that searches for files that should be updated and 
puts them into position - it was only a few lines of shell script and runs 
each hour. Just wondered when that feature from 2013 might get implemented 
:-)

Thanks,

Iain.

On Wednesday, 12 January 2022 at 17:37:52 UTC Josh Cooper wrote:

> On Wed, Jan 12, 2022 at 8:59 AM Iain Hallam  wrote:
>
>> I find myself needing to manage a file that has content that to Puppet 
>> looks like a checksum. It isn't, but because Puppet sees any file content 
>> line beginning with "{", 3 to 5 characters, "}", as a checksum, it doesn't 
>> accept the content but instead tries to find the file in a filebucket...
>>
>>
>> https://github.com/puppetlabs/puppet/blob/2f14ddd269c26cba36771d9b3464c2c29422e46a/lib/puppet/type/file/content.rb#L49
>>
>> I actually need to store "{CRYPT}$..." which isn't one of Puppet's 
>> recognised types.
>>
>> It seems there's no way to work around this in pure Puppet code, so I 
>> can't manage those files without doing something hackish, like putting a 
>> modified form of the content in a file alongside then having a script on 
>> the machine that puts it in the correct place without the modifications, 
>> but the issue for removing this behaviour was last updated in 2018:
>>
>
> I'd use the "checksum" and "checksum_value" parameters along with the 
> "source" parameter. That way the agent can determine if the file needs 
> updating without needing the full content in the catalog, and the agent can 
> download the source as needed, potentially from a regular file server, e.g. 
> https://
>
>
>> https://tickets.puppetlabs.com/browse/PUP-1043
>>
>> It says it will now target Puppet 7, which came and went some time ago. 
>> Does anyone know if there will be a new target for this?
>>
>> Thanks,
>>
>> Iain Hallam.
>>
>> -- 
>> 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/72752c00-68db-4db2-98ff-b2d42ddeadedn%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Josh Cooper
> Software Engineer
> jo...@puppet.com
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/749ce92e-9825-4063-8dec-aa80567cdd18n%40googlegroups.com.


Re: [Puppet Users] File content misrecognised as checksum

2022-01-12 Thread Josh Cooper
On Wed, Jan 12, 2022 at 8:59 AM Iain Hallam  wrote:

> I find myself needing to manage a file that has content that to Puppet
> looks like a checksum. It isn't, but because Puppet sees any file content
> line beginning with "{", 3 to 5 characters, "}", as a checksum, it doesn't
> accept the content but instead tries to find the file in a filebucket...
>
>
> https://github.com/puppetlabs/puppet/blob/2f14ddd269c26cba36771d9b3464c2c29422e46a/lib/puppet/type/file/content.rb#L49
>
> I actually need to store "{CRYPT}$..." which isn't one of Puppet's
> recognised types.
>
> It seems there's no way to work around this in pure Puppet code, so I
> can't manage those files without doing something hackish, like putting a
> modified form of the content in a file alongside then having a script on
> the machine that puts it in the correct place without the modifications,
> but the issue for removing this behaviour was last updated in 2018:
>

I'd use the "checksum" and "checksum_value" parameters along with the
"source" parameter. That way the agent can determine if the file needs
updating without needing the full content in the catalog, and the agent can
download the source as needed, potentially from a regular file server, e.g.
https://


> https://tickets.puppetlabs.com/browse/PUP-1043
>
> It says it will now target Puppet 7, which came and went some time ago.
> Does anyone know if there will be a new target for this?
>
> Thanks,
>
> Iain Hallam.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/72752c00-68db-4db2-98ff-b2d42ddeadedn%40googlegroups.com
> 
> .
>


-- 
Josh Cooper
Software Engineer
j...@puppet.com

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2Bu97ukKrV6TDs34nh5EbyZ5WnGa-vNLAcLGAf9napOQHBZP%2BQ%40mail.gmail.com.


[Puppet Users] File content misrecognised as checksum

2022-01-12 Thread Iain Hallam
I find myself needing to manage a file that has content that to Puppet 
looks like a checksum. It isn't, but because Puppet sees any file content 
line beginning with "{", 3 to 5 characters, "}", as a checksum, it doesn't 
accept the content but instead tries to find the file in a filebucket...

https://github.com/puppetlabs/puppet/blob/2f14ddd269c26cba36771d9b3464c2c29422e46a/lib/puppet/type/file/content.rb#L49

I actually need to store "{CRYPT}$..." which isn't one of Puppet's 
recognised types.

It seems there's no way to work around this in pure Puppet code, so I can't 
manage those files without doing something hackish, like putting a modified 
form of the content in a file alongside then having a script on the machine 
that puts it in the correct place without the modifications, but the issue 
for removing this behaviour was last updated in 2018:

https://tickets.puppetlabs.com/browse/PUP-1043

It says it will now target Puppet 7, which came and went some time ago. 
Does anyone know if there will be a new target for this?

Thanks,

Iain Hallam.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/72752c00-68db-4db2-98ff-b2d42ddeadedn%40googlegroups.com.


[Puppet Users] file content

2010-11-24 Thread Arnau Bria
Hi all,

I have a problem when adding content to a file. I know this sound
basic, but I don't know what I'm doing wrong...

my server runs puppet-server-2.6.3-0.4.el5 and client
puppet-2.6.1-0.6.el5.


I firs defined a file like:

file {  'default_dns':
name= '/etc/resolv.conf',
content = search mydomain.com \nnameserver 192.168.1.1 \nnameserver 
192.168.1.2; }

It returns the error:
You cannot specify more than one of content, source, target at ...

SO I tried the example from
http://docs.puppetlabs.com/references/stable/type.html#file like


$srt=search mydomain.com \nnameserver 192.168.1.1 \ 
\nnameserver192.168.1.2

file {
   'default_ntp':
 name= '/etc/ntp.conf',
 content = $srt#
} }

*notice double { at the end, as the exmaple shows, alo tried with simple } 
with , and ; after $srt 

All my combinations produce and error. Double } syntax one (is doc wrong?) and 
others same as above...

So, how may I specify file content?


TIA,
Arnau

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] file content

2010-11-24 Thread Mohit Chawla
Hi,

On Wed, Nov 24, 2010 at 5:02 PM, Arnau Bria arnaub...@pic.es wrote:

 SO I tried the example from
 http://docs.puppetlabs.com/references/stable/type.html#file like


In that example, a define is being used, called resolve. There is no extra
curly bracket, the formatting of the documentation looks a bit screwed.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] file content

2010-11-24 Thread Ohad Levy
Hi,

You probably have a File statement somewhere (like site.pp) which has a
default source or target attributes.

Ohad

On Wed, Nov 24, 2010 at 2:06 PM, Arnau Bria arnaub...@pic.es wrote:

 On Wed, 24 Nov 2010 17:27:23 +0530
 Mohit Chawla wrote:

  Hi,
 
  On Wed, Nov 24, 2010 at 5:02 PM, Arnau Bria arnaub...@pic.es wrote:
 
   SO I tried the example from
   http://docs.puppetlabs.com/references/stable/type.html#file like
 
 
  In that example, a define is being used, called resolve. There is no
  extra curly bracket, the formatting of the documentation looks a bit
  screwed.
 You're right.

 anyway, without the define, that should be something like:

 file { my_file:
content = my content,
 }

 and that produces an error in my code.


 Thanks for your answer,
 Cheers,
 Arnau

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.compuppet-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.