Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-5190

RH294-229: 5.3 Deploying Custom Files with Jinja2 Templates

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Minor Minor
    • AU294 - RHAAP2.X NEXT
    • RH294 - RHEL9.0-en-2-20221117
    • RH294
    • None
    • 5
    • en-US (English)

      URL:
      Reporter RHNID:
      Section: -
      Language: en-US (English)||||||||
      Workaround:

      Description: While we get a couple of examples here of Jinja for loops, the conditional section shows only a single example. I think a couple more if statements could be added.
      Consider something like the following.

      {# Provide a hint on installed memory #}
      Memory details:
      {% if ansible_facts['memtotal_mb'] > 2048 %}
      Looks like you have more than 2GBs installed.
      {% else %}
      Less than 2GBs intalled.
      {% endif %}
      
      {# CPU arch #}
      Processor type: {{ 'Intel' | upper if ansible_architecture == 'x86_64' else 'Uncommon' }}
      

      Also the filter section could use a few different examples. Comparison to the filter commands in Linux such as 'sort', 'tr', etc. could also help students relate to them better.

              glsbugs-automation@redhat.com PTL - Ansible Team
              zoltanmolnar Zoltan Molnar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: