Project

General

Profile

Actions

Feature #13260

open

RFE : allowing hammer-cli to search/update sc-parameters

Added by Fabian Arrotin almost 9 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Yes
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:
yes

Description

Hi,

Would it be possible to add the following feature to hammer-cli ? (and also in foreman webui, as it's not possible right now) :
Let's assume that a bunch of hosts in Foreman are using the puppet class puppet::class and that class has some variables. One variable (from a puppet point of view) can be $puppet::class:var1 and comes with a default value of 'foo'). Some hosts are using different value for that sc-parameter (for example 'bar' , through overrides)
How would it be possible to search for hosts that have that specific $puppet::class:var1 = 'bar' through webui (and then through hammer-cli) ?
From a discussion on irc, I was told that it's currently not possible.

That would be for step1, as then how would one update those hosts with a different value (for example changing $puppet::class:var1 from 'bar' to 'other_value')

Actually there is a way to find a list of hosts using that specific puppet class with " hammer host list --search 'class=puppet::class' ", but that doesn't get me the list of the hosts having a particular value for sc.

Happy to give more details if required, and thanks a lot !


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #13517: Searching for smart class parameter override values in the API results into a 404ClosedActions
Related to Foreman - Feature #13519: Inconsistent naming in search and output when searching on smart class parametersClosedShlomi Zadok02/02/2016Actions
Actions #1

Updated by Ewoud Kohl van Wijngaarden almost 9 years ago

https://gist.github.com/ekohl/58d97e3c4d3f8394c0d1 is a python script that uses the API to achieve this. I've opened #13517 and #13519 to make it more efficient, but I think this does what you want.

Actions #2

Updated by Ewoud Kohl van Wijngaarden almost 9 years ago

  • Related to Bug #13517: Searching for smart class parameter override values in the API results into a 404 added
Actions #3

Updated by Ewoud Kohl van Wijngaarden almost 9 years ago

  • Related to Feature #13519: Inconsistent naming in search and output when searching on smart class parameters added
Actions #4

Updated by Ondřej Pražák almost 5 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by Shira Maximov almost 5 years ago

  • In Kanboard set to yes
Actions

Also available in: Atom PDF