Editing repo.jdbc.json with Chef

Tagged: 

This topic has 3 replies, 2 voices, and was last updated 6 years, 10 months ago by Matt Mencel.

  • Author
    Posts
  • #1587
     Matt Mencel
    Participant

    Hi,

    I’m building a Chef cookbook that installs OpenIDM. I’m using a template to create the repo.jdbc.json file in the conf directory. Which works great except that it seems that when you start the OpenIDM service….it also edits that json file. So every time Chef runs it rewrites it back to what it thinks it should be.

       @@ -215,10 +220,7 @@
                             "mapping" : "mapping",
                             "exception" : "exceptiondetail",
                             "message" : "message",
        -                    "messageDetail" : {
        -                        "column" : "messagedetail",
        -                        "type" : "JSON_MAP"
        -                    }
        +                    "messageDetail" : { "column" : "messagedetail", "type" : "JSON_MAP" }
                         }
                     },
                     "audit/access" : {
    

    It’s removing those messageDetail column and type fields. So it’s looking like I shouldn’t be editing the repo.jdbc.json file with Chef. Not unless I can just limit it to editing the few lines I need (username and password).

    #1820
     tim.sedlack
    Participant

    Matt – I see you kind of came to your own conclusion there at the end, did that solve your issue, or do you still have an open question?

    Tim

    #1821
     Matt Mencel
    Participant

    Hi Tim,

    I’m attempting to write an “Edit JSON” LWRP that will only modify the few entries necessary and leave the rest of the file alone. I’m using Ruby’s FLOCK to lock the file to prevent write collisions on the file too.

    Haven’t got it working in Chef yet, but it works running the code manually from the command line.

    Once I’ve got that working I may publish my OpenIDM cookbook to the Chef Supermarket….or minimally to my Github account so someone better than me can take it and make it better. :)

    Matt

    #1870
     Matt Mencel
    Participant

    First attempt at an OpenIDM Chef cookbook. I don’t think it’s complete yet, but it should get a basic OpenIDM instance setup with a MySQL DB. My LWRP for editing the repo.jdbc.json seems to be working too and I think it’s thread safe as long as the OpenIDM service pays attention to file locks.

    https://github.com/MattMencel/chef-openidm

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

©2021 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?