can create a top level variable in my enc

19 views
Skip to first unread message

Alex Samad

unread,
Jul 6, 2016, 3:01:10 AM7/6/16
to Puppet Users
Hi

I have a bash script produce this for my test node

---
environment: production
ybenv: alextest


I have this in my hiera.yaml file
:hierarchy:

  # node specific
  - "nodes/%{::trusted.certname}"

  # OS specific
  - "os/%{::osfamily}"

  # Envornment 
  - "ybenv/%{::ybenv}"

  # common to all
  - common


These are my hieradata files
hieradata/
hieradata/os
hieradata/os/RedHat.yaml
hieradata/nodes
hieradata/nodes/testnode.yaml
hieradata/common.yaml
hieradata/ybenv
hieradata/ybenv/alextest.yaml


But this file doesn't seem to be getting read
hieradata/ybenv/alextest.yaml

and tried doing some testing in my site.pp

tried this
$ybenv=hiera('ybenv')
info("Certname [${trusted['certname']}] OsName [${osfamily}] ybenv [${ybenv}] environment [${environment}]")

and also just this

info("ybenv [${ybenv}]")

and it the logs it say ybenv undefined 



A
 

R.I.Pienaar

unread,
Jul 6, 2016, 3:03:46 AM7/6/16
to puppet-users


----- Original Message -----
> From: "Alex Samad" <al...@samad.com.au>
> To: "puppet-users" <puppet...@googlegroups.com>
> Sent: Wednesday, 6 July, 2016 09:01:10
> Subject: [Puppet Users] can create a top level variable in my enc

> Hi
>
> I have a bash script produce this for my test node
>
> ---
> environment: production
> ybenv: alextest


---
environment: foo
parameters:
ybenv: foo

https://docs.puppet.com/guides/external_nodes.html#parameters
> --
> 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/0c3c410c-cad1-47e6-a017-3a177458bc8d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Alex Samad

unread,
Jul 6, 2016, 3:18:45 AM7/6/16
to Puppet Users
Thanks - finally found it myself - been looking for days on this

---
environment: production

parameters:
  ybenv: alextest


from 

Learning Puppet 4: A Guide to Configuration Management and Automation


it actually says ENC paramaters are not the same as parameters anywhere else in puppet.


wasn't too clear on that page... 

thanks again
Reply all
Reply to author
Forward
0 new messages