Here is my scenario, i have list of servers in my clusterA , i want to
provide that list of servers to a script ,
the script will then read this list( of servers) and will do some action
on a file, basically add/remove entires of those hosts in the file.
How can i achieve this, i can create this list dynamically using the knife
search query from a recipe and then put the output in a file , but i have
to have knife installed on all nodes then correct ?
Or i can run this knife query from outside on the chef server put the
output in the cookbook file folder , that also is a process breaker as i
have to run it on the server first then do the other stuff .
Is there a better way to handle this scenario , Please advise.
Here is my scenario, i have list of servers in my clusterA , i want to provide that list of servers to a script ,
the script will then read this list( of servers) and will do some action on a file, basically add/remove entires of those hosts in the file.
How can i achieve this, i can create this list dynamically using the knife search query from a recipe and then put the output in a file , but i have to have knife installed on all nodes then correct ?
Or i can run this knife query from outside on the chef server put the output in the cookbook file folder , that also is a process breaker as i have to run it on the server first then do the other stuff .
Is there a better way to handle this scenario , Please advise.
you can use the search method in recipe to get the list of hosts (and save
it in a file if you want), and pass it to the consumer script. also any
script with read access to to the chef client can search chef server and
obtain the list independently .
Here is my scenario, i have list of servers in my clusterA , i want to
provide that list of servers to a script ,
the script will then read this list( of servers) and will do some action
on a file, basically add/remove entires of those hosts in the file.
How can i achieve this, i can create this list dynamically using the knife
search query from a recipe and then put the output in a file , but i have
to have knife installed on all nodes then correct ?
Or i can run this knife query from outside on the chef server put the
output in the cookbook file folder , that also is a process breaker as i
have to run it on the server first then do the other stuff .
Is there a better way to handle this scenario , Please advise.