Skip to content

infra.aap_configuration.job_templates does not allow escaping curly braces in extra vars #1044

@ericcames

Description

@ericcames

Summary

The module does not allow for extra vars to properly set variables that will be fed in at runtime when the job template that is being built is run for its intended purpose.

Issue Type

  • Bug Report

Ansible, Collection, Controller details

ansible --version
ansible [core 2.16.14]

ansible-galaxy collection list
collections:
  - name: amazon.aws
    version: 7.2.0
  - name: ansible.posix
    version: 1.6.2
  - name: ansible.utils
    version: 5.1.2
  - name: ansible.platform
    version: 2.5.3
  - name: ansible.hub
    version: 1.0.0
  - name: ansible.controller
    version: 4.6.2
  - name: ansible.eda
    version: 2.2.0
  - name: infra.aap_configuration
    version: 3.1.0
  - name: servicenow.itsm
    version: 2.4.0
  - name: servicenow.servicenow
    version: 1.0.6
  - name: community.mysql
    version: 3.8.0
  - name: community.general
    version: 8.1.0
  - name: redhat.rhel_system_roles
    version: 1.88.9
  - name: redhat.satellite
    version: 5.1.0

Controller version
Automation Controller Version
4.6.8

AAP 2.5 Containerized install

OS / ENVIRONMENT

Red Hat Enterprise Linux release 9.5 (Plow)

Desired Behavior

Image

Actual Behavior

The job template is built with the extra vars that looks like this:

update_requested_item_comments: |-
Provisioning details

Machine Create Time: {{ vm_machine_create_time }}

RedHat Subscription Time: {{ rhsm_subscription_time }}

Post Install Time: {{ linux_post_install_time }}

Website Start Time: {{ lamp_setup_time }}

Public DNS Name: {{ get_instance_info_server }}

Public IP Address: {{ get_instance_info_public_ip }}

AWS AMI ID: {{ get_instance_info_ami_id }}

AWS Instance ID: {{ get_instance_info_instance_id }}

AWS Instance Type: {{ get_instance_info_instance_type }}

AWS availability zone: {{ get_instance_info_availability_zone }}
update_requested_item_state: 3

Please give some details of what is actually happening.
Include a [minimum complete verifiable example] with:

  • playbook / task
  • configuration file / list
  • error

STEPS TO REPRODUCE

Fork the https://github.com/ericcames/aap.dailydemo.linux/tree/main gitrepo
Create a job template using https://github.com/ericcames/aap.dailydemo.linux/blob/main/playbooks/setup_demo.yml

use the following extra vars
my_organization: AmesCO
my_vault: Eric Ames
my_rh_aap_credential: aap.kona.services
my_aws_credential: AWS Blank Open Environment pvwk8
my_aws_machine_credential: AWS Machine Credential - Ames
my_itsm_credential: ServiceNow ITSM Credential - Ames
my_itsm_username: hercules
my_sat_credential: sat.kona.services
timezone_id: America/Phoenix
satellite_host: https://sat.kona.services
remotevault: true
my_remote_vault: >-
https://raw.githubusercontent.com/ericcames/aap.as.code/refs/heads/main/playbooks/files/vaults/ames/vault_ames.yml
aap_configuration_async_retries: 60

Run this playbook after creating the vars file listed below.
https://github.com/ericcames/aap.dailydemo.linux/blob/main/playbooks/setup_demo.yml

---
controller_templates:
- name: DDL - Update request ticket - success
    job_type: run
    inventory: AAP Managed Inventory
    organization: "{{ my_organization }}"
    execution_environment: Default execution environment
    project: aap.dailydemo.linux
    playbook: playbooks/servicenow/update_sn_req_itm.yml
    credentials:
      - "{{ my_itsm_credential }}"
    extra_vars:
      update_requested_item_comments: |-
          Provisioning details

          Machine Create Time: \{\{ vm_machine_create_time \}\}

          RedHat Subscription Time: \{\{ rhsm_subscription_time \}\}

          Post Install Time: \{\{ linux_post_install_time \}\}

          Website Start Time: \{\{ lamp_setup_time \}\}

          Public DNS Name: \{\{ get_instance_info_server \}\}

          Public IP Address: \{\{ get_instance_info_public_ip \}\}

          AWS AMI ID: \{\{ get_instance_info_ami_id \}\}

          AWS Instance ID: \{\{ get_instance_info_instance_id \}\}

          AWS Instance Type: \{\{ get_instance_info_instance_type \}\}

          AWS availability zone: \{\{ get_instance_info_availability_zone \}\}
      update_requested_item_state: 3

  - name: DDL - Update request ticket - failure
    job_type: run
    inventory: AAP Managed Inventory
    organization: "{{ my_organization }}"
    execution_environment: Default execution environment
    project: aap.dailydemo.linux
    playbook: playbooks/servicenow/update_sn_req_itm.yml
    credentials:
      - "{{ my_itsm_credential }}"
    extra_vars:
      update_requested_item_comments: |-
        Uh-Oh something broke.

        ServiceNow incident number: \{\{ create_incident_ticket \}\}

        Ansible Job ID: \{\{ vm_my_job_id \}\}

        Message: \{\{ vm_my_error \}\}
      update_requested_item_state: 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnewNew issue, this should be removed once reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions