How can I change a file with Chef?

后端 未结 4 1066
闹比i
闹比i 2020-11-29 04:24

I have 7 files and 1 war. I need to change values when I deploy them. I have this:

##usuario
#alfresco.user=*****
alfresco.user=********
##pass 
#alfresco.p         


        
4条回答
  •  爱一瞬间的悲伤
    2020-11-29 04:50

    As of 2020, the solutions provided are discouraged - see here and here.

    The modern way of performing file manual editing is to use the official, community-maintained, cookbook line.

    Example:

    replace_or_add "why hello" do
      path "/some/file"
      pattern "Why hello there.*"
      line "Why hello there, you beautiful person, you."
    end
    

    It's crucial, before using such strategy, to be 100% sure that manual editing is really required, but this is strictly dependent on the use case.

提交回复
热议问题