Are defines supported to be used in Foreman? I've imported all my
Puppet classes but have not found any documentation or method
describing how to assign a define to a host.
Thanks
- Trey
Are defines supported to be used in Foreman? I've imported all my
Puppet classes but have not found any documentation or method
describing how to assign a define to a host.
Thanks
> Are defines supported to be used in Foreman? I've imported all my
> Puppet classes but have not found any documentation or method
> describing how to assign a define to a host.
Craig
I think the complication is similar to a post I saw you posted, is
that I use defines that would require passing hashes as parameters
which isn't easy pre-2.7.x. Does anyone have an example of how to use
the create_resources library from here https://github.com/puppetlabs/puppetlabs-create_resources
? Is that the best approach to passing hashes to a class rather than
using defines? I just having a bit of trouble getting my head wrapped
around how to use create_resources.
Thanks
After a bit of clarification on how to use create_resources to pass
hashes…I now am wondering how I would use
create_resource("apache::vhost", $vhost) in Foreman. Would I include
that in a class called apache::vhost so it's visible in Foreman?
>
>
>> I think the complication is similar to a post I saw you posted, is
>> that I use defines that would require passing hashes as parameters
>> which isn't easy pre-2.7.x. Does anyone have an example of how to use
>> the create_resources library from herehttps://github.com/puppetlabs/puppetlabs-create_resources
>> ? Is that the best approach to passing hashes to a class rather than
>> using defines? I just having a bit of trouble getting my head wrapped
>> around how to use create_resources.
>>
>> Thanks
>> - Trey
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>>> Are defines supported to be used in Foreman? I've imported all my
>>>> Puppet classes but have not found any documentation or method
>>>> describing how to assign a define to a host.
>>
>>> ----
>>> Use parameters but beware that they come out as a string.
>>
>>> Craig
>
>
> After a bit of clarification on how to use create_resources to pass
> hashes…I now am wondering how I would use
> create_resource("apache::vhost", $vhost) in Foreman. Would I include
> that in a class called apache::vhost so it's visible in Foreman?
I was getting close I think but I did have to move on - just started deploying yesterday.
The gist of my understanding is this… it probably doesn’t matter if you use defines or create_resources - no matter what, you will have to compress what is essentially YAML into a string to enter in the ENC and then refactor the string back to YAML to use either in defines or create_resources. Start simple… remember that YAML is very sensitive to whitespace. I was of the mind set that I would write my input files out in YAML, write a program to convert that to an acceptable string and write a parser that would convert that string back to YAML before it was applied to ‘defines’.
This definitely could use a working example - I just never got it to work and had to move on.
Craig