Uploaded image for project: 'Ansible Automation Platform RFEs'
  1. Ansible Automation Platform RFEs
  2. AAPRFE-2108

Support for Jinja Filters (e.g., regex_replace) in Ansible Rulebook Conditions and Actions

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 2.5
    • event-driven-ansible
    • False
    • Hide

      None

      Show
      None
    • False

      1. What is the nature and description of the request?
         The customer requests support for standard Jinja2 filters, such as regex_replace in Ansible Rulebooks, specifically within condition and action fields of rules defined in Event-Driven Ansible (EDA) within AAP 2.5. These filters are commonly used in Ansible playbooks but currently fail with errors such as:
        ~~~
        ansible_rulebook.cli - ERROR - Terminating No filter named 'regex_replace'
        ~~~
        This limitation impacts the ability to perform basic string manipulation or pattern extraction on event data within rulebooks.
      2. Why does the customer need this? (List the business requirements here)

      The customer is attempting to automate certificate distribution in environments where a certificate management agent cannot be installed. Certificates are generated on a central server, and their filenames indicate the target server. EDA is intended to detect newly created or modified certificate files and trigger a job template to copy these to the correct server.

      Without support for 'regex_replace', the customer cannot parse {{'event.path' }}to determine the target host from the file name, making automation impossible. As a result, they are forced to continue with a manual process, which is inefficient and error-prone

      1. How would you like to achieve this? (List the functional requirements here)
      • Enable support for standard Jinja2 filters (e.g., regex_replace, basename, etc.) within:
        • The 'condition' section of rules
        • Any templated fields in the 'action' section (e.g., 'limit')
      • Ensure the filters available in playbooks are consistent with those in rulebooks, or provide clear documentation on supported filters.

              dmendoza@redhat.com Dafne Mendoza
              rhn-support-apaygavh Abhishek Paygavhan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: