← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2007871] Re: Not rendering jinja variables - Debian/11/cloud

 

** Attachment removed: "logs collection"
   https://bugs.launchpad.net/cloud-init/+bug/2007871/+attachment/5648669/+files/cloud-init.tar.gz

** Description changed:

- 
- I run lxd profiles with cloud-init (#cloud-config) configurations, and I use jinja2 templating (## template: jinja) so I can use one profile that I can apply to many distros. It works great, except on some images I notice ignore the jinja2 template directives.
+ I run lxd profiles with cloud-init (#cloud-config) configurations, and I
+ use jinja2 templating (## template: jinja) so I can use one profile that
+ I can apply to many distros. It works great, except on some images I
+ notice ignore the jinja2 template directives.
  
  When I launch a new debian/11/cloud image, I noticed it does not adhere
  to the jinja2 template.
  
  config:
-   user.user-data: |
-     ## template: jinja
-     #cloud-config
+   user.user-data: |
+     ## template: jinja
+     #cloud-config
  {% if distro == 'centos' or 'rocky' -%}
-     users:
-     ~Do some stuff.....
+     users:
+     ~Do some stuff.....
  {%- endif %}
  {% if distro == 'debian' or 'ubuntu' -%}
-     users:
-     ~Do some stuff.....
+     users:
+     ~Do some stuff.....
  {%- endif %}
  
  The image has cloud-init 20.4.1, and has the jinja2 engine installed. So
  I don’t understand why it would not adhere to the jinja directives in
  the profile like all other distros do.
  
  I checked, the user-data file in /var/lib/cloud/seed/nocloud-net/ is
  exactly as it is in the profile, so that seems to pass correctly.
  
  If I issue: cloud-init query -f {{distro}} - I get the correct metadata
  variable of “debian”.
  
  If I issue: cloud-init devel render /var/lib/cloud/seed/nocloud-
  net/user-data -d
  
  it renders the entire user-data config, not just the jinja template
  variable like I normally see. It just seems to ignore the variable.
  
  LXD is cloud provider. Containers are hosted on-prem. Log collection attached.
  Thank you

** Summary changed:

- Not rendering jinja variables - Debian/11/cloud
+ Delete

** Description changed:

- I run lxd profiles with cloud-init (#cloud-config) configurations, and I
- use jinja2 templating (## template: jinja) so I can use one profile that
- I can apply to many distros. It works great, except on some images I
- notice ignore the jinja2 template directives.
- 
- When I launch a new debian/11/cloud image, I noticed it does not adhere
- to the jinja2 template.
- 
- config:
-   user.user-data: |
-     ## template: jinja
-     #cloud-config
- {% if distro == 'centos' or 'rocky' -%}
-     users:
-     ~Do some stuff.....
- {%- endif %}
- {% if distro == 'debian' or 'ubuntu' -%}
-     users:
-     ~Do some stuff.....
- {%- endif %}
- 
- The image has cloud-init 20.4.1, and has the jinja2 engine installed. So
- I don’t understand why it would not adhere to the jinja directives in
- the profile like all other distros do.
- 
- I checked, the user-data file in /var/lib/cloud/seed/nocloud-net/ is
- exactly as it is in the profile, so that seems to pass correctly.
- 
- If I issue: cloud-init query -f {{distro}} - I get the correct metadata
- variable of “debian”.
- 
- If I issue: cloud-init devel render /var/lib/cloud/seed/nocloud-
- net/user-data -d
- 
- it renders the entire user-data config, not just the jinja template
- variable like I normally see. It just seems to ignore the variable.
- 
- LXD is cloud provider. Containers are hosted on-prem. Log collection attached.
- Thank you
+ Delete

** Changed in: cloud-init
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/2007871

Title:
  Delete

Status in cloud-init:
  Invalid

Bug description:
  Delete

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/2007871/+subscriptions



References