← Back to team overview

cloud-init team mailing list archive

Re: Merge userdata and vendordata?

 

That makes total sense, thanks for the insight! So essentially there currently is no way then to merge userdata with vendordata. Does that sound correct?

On 8/20/19, 7:54 PM, "Jorgensen, Andrew" <ajorgens@xxxxxxxxxx> wrote:

    Unfortunately merging only happens within a configuration source, so for example you can merge multiple configs from /etc/cloud/cloud.cfg.d  and you can merge mime multipart parts from userdata, but a merge strategy doesn't define what happens when the file configs are merged with the userdata.
    
    See https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.launchpad.net%2Fcloud-init%2F%2Bbug%2F1532234&amp;data=02%7C01%7CThomas.Stringer%40microsoft.com%7C6d1a32a7747140a3da1c08d725c9b38f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637019420549308536&amp;sdata=AKrUYR7nJd5GDchK741Bwi8v2RX9ZNlHRqjPNoSmYwk%3D&amp;reserved=0 for some background and thinking on this.
    
    Kind Regards,
    Andrew Jorgensen
    
    ________________________________________
    From: Cloud-init <cloud-init-bounces+ajorgens=amazon.com@xxxxxxxxxxxxxxxxxxx> on behalf of Thomas Stringer <Thomas.Stringer@xxxxxxxxxxxxx>
    Sent: Tuesday, August 20, 2019 12:51 PM
    To: cloud-init@xxxxxxxxxxxxxxxxxxx
    Subject: [Cloud-init] Merge userdata and vendordata?
    
    I'm currently trying to figure out how to prevent userdata from overwriting vendordata. I was under the impression that specifying merge_how for _both_ userdata and vendordata might be the solution, but in my testing I am not seeing this.
    
    Userdata - /var/lib/cloud/instance/user-data.txt
    ===========================
    #cloud-config
    merge_how:
     - name: list
       settings: [append]
     - name: dict
       settings: [no_replace, recurse_list]
    
    runcmd:
      - echo hello world from user  > /run/hello_world_user
    
    Vendordata - /var/lib/cloud/instance/vendor-data.txt
    ===========================
    #cloud-config
    merge_how:
     - name: list
       settings: [append]
     - name: dict
       settings: [no_replace, recurse_list]
    
    runcmd:
      - echo hello world from vendor  > /run/hello_world_vendor
    
    
    I would expect the existence of _both_ files, /run/hello_world_user and /run/hello_world_vendor. But only /run/hello_world_user exists. Am I doing something wrong? If merge_how isn't the way to merge vendordata and userdata, is there another way?
    
    Thank you in advance!
    Thomas
    
    --
    Mailing list: https://nam06.safelinks.protection.outlook.com/?url=https:%2F%2Flaunchpad.net%2F~cloud-init&amp;data=02%7C01%7CThomas.Stringer%40microsoft.com%7C6d1a32a7747140a3da1c08d725c9b38f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637019420549308536&amp;sdata=Qi565PAomMXr6Tkr5cJOuCfbt5puzxHUefD1x1YJaXU%3D&amp;reserved=0
    Post to     : cloud-init@xxxxxxxxxxxxxxxxxxx
    Unsubscribe : https://nam06.safelinks.protection.outlook.com/?url=https:%2F%2Flaunchpad.net%2F~cloud-init&amp;data=02%7C01%7CThomas.Stringer%40microsoft.com%7C6d1a32a7747140a3da1c08d725c9b38f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637019420549308536&amp;sdata=Qi565PAomMXr6Tkr5cJOuCfbt5puzxHUefD1x1YJaXU%3D&amp;reserved=0
    More help   : https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhelp.launchpad.net%2FListHelp&amp;data=02%7C01%7CThomas.Stringer%40microsoft.com%7C6d1a32a7747140a3da1c08d725c9b38f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637019420549308536&amp;sdata=9PWuxb1tbEMnIQKAXPj1n4hWFkYnqL6VCyif%2FlDavBw%3D&amp;reserved=0
    


Follow ups

References