1

I've started to use cloud-config to initialize my Ubuntu 16.04 VM instances on Cloudstack. In my cloud-config, I'm trying to use the public key of a key pair created in Cloudstack with this Jinja template :

## template: jinja
#cloud-config
cloud_init_modules:
  - users-groups

users:
  - default
  - name: xyz
    ssh-authorized-keys:
      - ssh-rsa {{ v1.public_ssh_keys }}
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
    groups: sudo
    shell: /bin/bash

I receive the following error message :

2019-07-16 19:27:35,737 - jinja_template.py[WARNING]: Ignoring jinja template for part-001. Could not find supported sub-handler for type text/jinja2
No 'init' modules to run under section 'cloud_init_modules'

The key is however correctly passed in the instance data :

# cloud-init query v1.public_ssh_keys
[
 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0EyQVA+A+CnrVBo7psi4XuZIbS6Zxq3JtiJK/wCZoPB3vKdvtDtwYkrFf1gBg4rzLDJiTTbbYZaPDa0IP82jdwSBBTzjJbF9mbeJfG70DbWqgzxzU40/fJibD1GqsEmFGh9jDAyyGLDuYo5o6LEprr3n6WIDbcsIlZFSr648RhpvTT8RmAcBj26/fkLsG2lSsQlNkWelSFj4kTn5FRcEbFb1QwwAwMza4gCqz4x3pmoqB/tSc81YRVDosik972j3+Np7Unz16PBbe6Sri5JYZaT5muS7baY9M87Nu/cOKZkr6kkxpGTHIKv6tW71f/CQVcTLEz9IG55xghAjVq9Kv"
]

I've tried with the package python-jinja2 installed (apt-get install -y python-jinja2) but it doesn't fix my issue.

danielbfox
  • 21
  • 1

0 Answers0