Search code examples
jenkinschef-infraknife

Modify chef role attributes from jenkins


I would like to update a chef role attribute from Jenkins.

The knife command: Knife role edit role-name

Appears to open a text file from a defined editor where changes can be made and then saved. This doesn’t seem like a feasible solution from Jenkins. Are there any options for achieving this?


Solution

  • Thanks for your responses. The solution I went with was to call

    knife role show role-name
    

    persist the output and update the attributes I wanted to modify using jq. Then, update the role using the updated json using

    knife role from file FILE
    

    I hope this help someone else in the future.