Pass value hiera agent

6 views
Skip to first unread message

Albert Shih

unread,
Sep 16, 2019, 9:53:33 AM9/16/19
to puppet...@googlegroups.com
Hi


I would like to know if it's possible (for dev/test) to pass a value for
some hiera variable through the puppet agent cli ?

For exemple I got a in my fqdn.yaml

status: production

but I would like to do something like

puppet agent -vt --???? status: dev

Is that possible ?

Regards.
--
Albert SHIH
Observatoire de Paris
xmpp: j...@obspm.fr
Heure local/Local time:
Mon 16 Sep 2019 03:50:48 PM CEST

Dirk Heinrichs

unread,
Sep 17, 2019, 1:45:42 AM9/17/19
to puppet...@googlegroups.com
Am Montag, den 16.09.2019, 15:53 +0200 schrieb Albert Shih:

I would like to know if it's possible (for dev/test) to pass a value for
some hiera variable through the puppet agent cli ? 

For exemple I got a in my fqdn.yaml

  status: production

but I would like to do something like

  puppet agent -vt --???? status: dev

Is that possible ? 

Not sure. However, here's how I do this:

  1. Setup a "development" environment on your master
  2. On the development agents put "environment = development" into their puppet.conf
  3. Make sure your hiera.yaml (on the master) contains an entry for the environment in its ":hierarchy:" section, like "environment/%{environment}", somewhere before "common".
  4. In your hiera directory (where your common.yaml is), create a new file "environment/development.yaml" and put your values into it.

This, combined with putting your Puppet-related stuff into a Git repository, allows you to easily setup different environments on your Puppet master by cloning the repository multiple times and checking out different branches.

HTH...

Dirk
-- 
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
Reply all
Reply to author
Forward
0 new messages