The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #14311

Expose catalog version

Added by Haw Loeung over 2 years ago. Updated 6 months ago.

Status:Needs More InformationStart date:05/03/2012
Priority:NormalDue date:
Assignee:Kelsey Hightower% Done:

0%

Category:-
Target version:-
Affected Puppet version: Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/PUP-2019


Description

Hi,

Would it be possible to expose the catalog version so that something like the following in the puppet.conf would work?

postrun_command=/usr/local/sbin/postrun.sh $environment $catalog.version

I’ve tried parsing the last_run_summary.yaml file but that is only updated after postrun is executed.

History

#1 Updated by Kelsey Hightower over 2 years ago

  • Status changed from Unreviewed to Needs More Information
  • Assignee set to Haw Loeung

Haw,

In order to help us make a better decision on accepting this, it would help if you provided a use case. What are you trying to accomplish in your postrun script? Why would a custom report processor not work for you?

Thanks.

#2 Updated by Haw Loeung over 2 years ago

Hi Kelsey,

Kelsey Hightower wrote:

Haw,

In order to help us make a better decision on accepting this, it would help if you provided a use case. What are you trying to accomplish in your postrun script? Why would a custom report processor not work for you?

First of all, thank you for replying.

Our current set up is that we have a live/production environment and multiple environments for each user to play and test with (e.g. hloeung, user2, user3, …). Developers are able to apply changes on certain nodes, test, make sure it all works before these changes are then merged into the live/production environment and rolled out across the board.

We also have directories such as /etc which are bazaar repositories to track changes. When the puppet run completes and adds new configuration files and such in these directories, the postrun script automatically commits them with a generic message such as “puppet auto-commit”.

What I would like, is to add more information to the generic auto-commit messages including the environment and the actual catalog number as provided by the puppet master (which is running on different nodes).

For example, it would look like this:

r100 - "puppet auto-commit hloeung r5001"  (Some changes were added by a puppet run using my environment)
r101 - "puppet auto-commit live r4980"     (Some changes were added by the live environment)
r102 - "puppet auto-commit hloeung r5002"  (Some more changes were added by a puppet run using my environment)
r103 - "puppet auto-commit user2 r4981"    (Some changes were added by a puppet run using user2's environment)
r104 - "puppet auto-commit live r4981"     (Some more changes were added by the live environment)
...

Currently, the environment is made available in the special variable $environment, but I would also like to see the $catalog.version (provided by the puppet master) made available somehow so I could pass this as an argument to the postrun script.

I’ve tried passing last_run_summary.yaml which has the catalog.version as “config_version” but that is updated after the postrun script is executed so therefore providing the catalog.version from the last run… which is incorrect.

#3 Updated by Alexandru Barbur about 1 year ago

So what’s the status on this? I think it would be pretty useful if it could also be a puppet set global variable so modules could take advantage of it too. For example, I have a puppet module that commits files to a git repository and I would like to have better commit messages (“Applying catalog version ${::catalog_version}” would be nice).

#4 Updated by Alexandru Barbur about 1 year ago

  • Assignee changed from Haw Loeung to K Hightower

I’m new here so I’m not too sure what the procedure is, but I’m just going to assign this back to the original developer so that someone sees it.

#5 Updated by Alexandru Barbur about 1 year ago

  • Assignee changed from K Hightower to Kelsey Hightower

#6 Updated by Peter Meier 6 months ago

Redmine Issue #14311 has been migrated to JIRA:

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

Also available in: Atom PDF