Cloud config not working at all with APIv2 on Ubuntu 18.04

Cloud config is not working at all from the command line with APIv2 on Ubuntu 18.04. Anyone experience this? Even this simple script doesn’t work:

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $MY_TOKEN" -d '{
        "name": "myserver", 
        "region": "sfo2", 
        "size": "s-1vcpu-1gb", 
        "image": "ubuntu-18-04-x64",
        "ssh_keys": ["XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX"],
        "user_data": "#cloud-config 
              - content |
                  This is a test file
                path: /etc/cloud-config-test
                permissions: '0600'
                owner: root:root"
}' ""

At first glance, examining /var/log/cloud-init.log, and /var/log/cloud-init-output.log, reveals nothing about the ‘user-data:#cloud-config’ entry in my APIv2 POST. Due to their size I left them out. I would be happy to share them if needed.



Running the same script below from the GUI does work, but from the command line in an http request as shown above it does not.

  - path: /etc/cloud-config-test
    permissions: '0600'
    owner: root:root
    content: |
        This is a test file.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!