Excuse my newbieness, but I'm having a basic misunderstanding regarding
loops.
Say I have: joesfriends = jack, sam, sally
I need to add each entry into a file - one per line.
$joesfriends.each | String $joesfriends| {# loop
file { "/etc/list_of_joes_friends":
line => "${joesfrie
Why does this:
class mymodule {
notify { "booboo": }
notify { "booboo": }
provoke the error:
Error while evaluating a Resource Statement, Duplicate declaration:
Notify[booboo] is already declared in file
That's is a simplified version of my actual use case:
$mythings.each |
On Thursday, November 23, 2017 at 5:20:54 PM UTC+1, Peter Faller wrote:
>
>
> The error occurs because you have two resources of the same type (notify)
> with the same name ('booboo'). Remember that 'notify' is not like a '
> log.info' - it is a resource in it's own right, and each 'notify' has
I'm trying to pull data from my cmdb into a variable, by downloading my
relevant data to a local json file and reading it in:
class get_cmdb {
file { "/tmp/${::hostname}.json":
source => "http://mycmdb.example.com/${::hostname}";
}
$mydata = loadjson("/tmp/${::hostname}.json")
The is
On Friday, December 1, 2017 at 5:59:51 PM UTC+1, R.I. Pienaar wrote:
>
>
> All functions like foo() run on the master during compile. It's a multi
> phase process, the only way a node can influence the compile time is
> using facts.
>
> You could integrate your CMDB with puppet using a hiera
an be used
> during catalog compilation. That seems like the perfect fit for your use
> case, except ENCs need to return yaml, not json.
>
>
Thanks, I'll investigate that option.
>
>
> Rob Nelson
> rnel...@gmail.com
>
> On Tue, Dec 5, 2017 at 5:13 AM, buoyant_
How can I get the result of an action and use it conditionally in my code?
As a very simple example:
package { "wget" : ensure => 'present' }
# if that failed, do X
To put this in context, some actual use cases I have:
- attempt to register an agent to a remote service and if that fails, open
a
On Thursday, December 28, 2017 at 2:10:22 AM UTC+1, John Gelnaw wrote:
>
>
> ... which *should* require the resource 'pkg::wget' to be compiled first,
> and then test for the package to be defined.
>
Thanks, that may work in some cases. I'm still trying to find a more
general approach, though.
This is an example I found online that would do what I want: check if a dir
exists and if so, do something:
class foo {
exec { "is foo present":
command => "/bin/true",
onlyif => "/usr/bin/test -d /foo"
}
file { "create a file if dir foo is present":
path => "/path/otherfoo",
I think I got this. My main issue was the 'true' logic with an 'onlyif',
because that's always only going to either run (= and therefore meet the
requirement) or not run at all (= which also meets the requirement since
it's not a failure).
I feel the choice of words here leaves room for confusi
Got it, thanks everyone.
Just one small point to add - I'm not actually directly concerned with
Execs here. If you look at my original example, I was needing to do a
conditional check like "if directory exists then...", and my Exec-based
solution for it is just an ugly workaround. I understand
Can I configure puppet to use a DNS name that would work on two different
hosts? For example, I have host1 and host2.example.com.
I'd like agents to connect to "puppet.example.com" which will point to one
of these. I wamt to be sure agents can connect to either without
certificate errors.
How
On Wednesday, May 2, 2018 at 2:59:33 PM UTC+2, jcbollinger wrote:
>
>
>
> On Wednesday, May 2, 2018 at 6:25:37 AM UTC-5, Gavin Williams wrote:
>>
>> 'dns_alt_names' is the config you're looking for...
>>
>>
>> https://puppet.com/docs/puppetserver/5.1/scaling_puppet_server.html#creating-and-confi
On Friday, May 4, 2018 at 3:13:41 PM UTC+2, jcbollinger wrote:
>
>
>
> On Thursday, May 3, 2018 at 9:54:11 AM UTC-5, buoyant_puppy wrote:
>>
>>
>>
>> On Wednesday, May 2, 2018 at 2:59:33 PM UTC+2, jcbollinger wrote:
>>>
>>>
>>>
&g
14 matches
Mail list logo