Ubuntu Pastebin

Paste from smoser at Wed, 1 Apr 2015 15:48:18 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/usr/bin/python


# put in python whatever data you want cloud-init to eventually load.
cloud_init_data = {"packages": ["htop"]}

import json
print(json.dumps(
   {'cloud-init': "#cloud-config\n" + json.dumps(cloud_init_data)}))

# or
#print(json.dumps(
#   {'cloud-init': ["#cloud-config\n" + json.dumps(cloud_init_data)]}))
Download as text