ruby - Chef: Increment value in a file each time the cookbook is applied -


one of recipes echoes static value file each time cookbook applied server, e.g.

bash 'example'   code <<-eof     echo "1" > /path/file.txt   eof end 

i increment value each time cookbook applied server. next time, /path/file.txt contain value "2", "3"...

this weird thing since non-convergent whatever floats boat:

ruby_block 'weird thing'   block     path = '/whatever.txt'     value = io.read(path).to_i     io.write(path, (value + 1).to_s)   end end 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -