Awx anisble collection syntax error

I have created a playbook to config the awx platform using the awx.awx collection. I have the tower_cli.cfg in my home directory and I have input environment of the host, username, and password. Below is the playbook I have attempted to run.

- hosts: localhost
  connection: local
  gather_facts: false
  collections:
    - awx.awx

  tasks:
    - name: Create Inventory
      awx.awx.inventory:
        name: "test"
        organization: "AWX_Admins"
        #controller_config_file: "{{ ansible_config_file }}"
        validate_certs: false
        state: present
      register: inventory
      failed_when: inventory.rc != 0

The Error I receive is

/collections/ansible_collections/awx/awx/plugins/module_utils/controller_api.py", line 154
    endpoint = hostname_prefix + f"{api_path}v2{endpoint}"
                                                         ^
SyntaxError: invalid syntax
fatal: [localhost]: FAILED! => 
  msg: Unexpected failure during module execution.
  stdout: ''"

What version of python do you have?

The python version is python2 and I think it was using ansible_config_file as a variable. I got it going. Thank you for reaching out

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.