I have this issue with chef, namely kitchen.local.yml
.
It overrides kitchen.yml
, that works.
But when I remove the overridden attribute, it behaves like it is not removed. It looks like it is somehow cached.
I can only change the value. This causes issues because i can't get the default attribute coming from the attributes/*.rb
.
This is .kitchen.local.yml
:
suites:
- name: default
run_list: [ "recipe[bbcpd-bpds-api]" ]
attributes: {
"bbcpd-bpds-api": {
"redis": {
#"host": "${REDIS_PORT_6379_TCP_ADDR:-10.0.2.2FOOO}",
### This above seems to stick even though commented out.
### Changing it FOOO to BAAR works.
### But removing keeps the BAAR appearing
### unless I `kitchen destroy` and recreate again.
}
}
I didn't find the FOOO
value on host machine except for the commented out line and logs.
On the guest machine (VM), I found it in /tmp
:
kitchen/dna.json:{"bbcpd-bpds-api":{"update_mode":true,"redis":{"dbIndex":"12","host":"${REDIS_PORT_6379_TCP_ADDR:-10.0.2.2FOOO}"},"storage":{"ccr":{"url":"https://ccr-dev-citc.bbcollab.com/v1","client":"BPDS-Client-Id","secret":"ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHunzoneunzoneunzoneunzoneunzoneunzoneunzoneunzone","tokenexpiry":"60","site":"Dev","container":"DevBPDSContainer"}},"libreoffice":{"binary":"/opt/libreoffice5.4/program/soffice"}},"run_list":["recipe[bbcpd-bpds-api]"]}
kitchen/nodes/default-centos-72.json: "host": "${REDIS_PORT_6379_TCP_ADDR:-10.0.2.2FOOO}",
I am not quite sure what is the role of these, but I suspected these are somehow involved in keeping the state.
I have tried to delete /tmp
but then, kitchen converge
stopped working. It needed kitchen create
to fix. But the ...FOOO
value appeared there again.
Running kitchen destroy && kitchen create
makes the value go away, but since there is no caching for the VM base image, it takes around 15 minutes, so I would like to avoid it.
Questions:
Where are these values being cached so that they stick even after removed from .kitchen.local.yml
?
How can I disable/clear that caching?
This is just how it works, sorry. You have to destroy and recreate the instance to see changes in attribute settings.