I took over an existing Chef server and it has several cookbooks with
multiple versions, with various environments locked to several of those
versions.
I now need to edit multiple cookbook versions to fix hardcoded items due to
changes in our environment and I was wondering what the best way to handle
making those changes would be?
I was thinking I could create various git branches on my workstation and
knife download the specific version, change the hardcode item(s), and force
a cookbook upload.
It’s not perfect, but it helps until I can move various
servers/environments to latest cookbook versions.
Or because I literally just need to change an IP address in a couple of
recipes for now, could I just go to the
/var/opt/chef-server/bookshelf/data/bookshelf
directory and quick edit the file or will that really break stuff?
I took over an existing Chef server and it has several cookbooks with
multiple versions, with various environments locked to several of those
versions.
I now need to edit multiple cookbook versions to fix hardcoded items due
to changes in our environment and I was wondering what the best way to
handle making those changes would be?
I was thinking I could create various git branches on my workstation and
knife download the specific version, change the hardcode item(s), and force
a cookbook upload.
It's not perfect, but it helps until I can move various
servers/environments to latest cookbook versions.
Or because I literally just need to change an IP address in a couple of
recipes for now, could I just go to the /var/opt/chef-server/bookshelf/data/bookshelf
directory and quick edit the file or will that really break stuff?
I took over an existing Chef server and it has several cookbooks with
multiple versions, with various environments locked to several of those
versions.
I now need to edit multiple cookbook versions to fix hardcoded items due
to changes in our environment and I was wondering what the best way to
handle making those changes would be?
I was thinking I could create various git branches on my workstation and
knife download the specific version, change the hardcode item(s), and force
a cookbook upload.
It's not perfect, but it helps until I can move various
servers/environments to latest cookbook versions.
I took over an existing Chef server and it has several cookbooks with
multiple versions, with various environments locked to several of those
versions.
I now need to edit multiple cookbook versions to fix hardcoded items due to
changes in our environment and I was wondering what the best way to handle
making those changes would be?
I was thinking I could create various git branches on my workstation and
knife download the specific version, change the hardcode item(s), and force
a cookbook upload.
It's not perfect, but it helps until I can move various servers/environments
to latest cookbook versions.
It sounds like you already understand the following, but just for
others on the list: It's not best practice to upload the same version
of something after you change the code underneath (you don't release
Microsoft Windows 2003 a hundred times for all the bug fixes, you make
a service pack).
Nevertheless, you can overwrite old versions of cookbooks on the Chef server:
knife cookbook download my-cookbook X.Y.Z
tar zxvf my-cookbook-X.Y.Z.tar.gz -C cookbooks
knife cookbook upload my-cookbook # might need to --force if X.Y.Z
is frozen on the server