redhat-cop / aap_configuration_extended

providing extended functionality that is not in aap_configuration
GNU General Public License v3.0
2 stars 8 forks source link

Filetree_create role failing with Unexpected templating type error when using input tag of teams or roles against my AAP instance #34

Open a083138 opened 2 days ago

a083138 commented 2 days ago

Summary

When running the filetree_create role against my AAP instance, it is failing ("Unexpected templating type error occurred...") when using the 'teams' or 'roles' input tag.

Issue Type

Ansible, Collection, Controller details

ansible --version
ansible [core 2.17.4]
  config file = None
  configured module search path = ['/Users/a083138/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/a083138/.ansible/collections:/usr/share/ansible/collections
  executable location = /Library/Frameworks/Python.framework/Versions/3.11/bin/ansible
  python version = 3.11.2 (v3.11.2:878ead1ac1, Feb  7 2023, 10:02:41) [Clang 13.0.0 (clang-1300.0.29.30)] (/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True

ansible-galaxy collection list
# /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansible_collections
Collection                               Version
---------------------------------------- -------
amazon.aws                               8.2.1  
ansible.netcommon                        6.1.3  
ansible.posix                            1.5.4  
ansible.utils                            4.1.0  
ansible.windows                          2.5.0  
arista.eos                               9.0.0  
awx.awx                                  24.6.1 
azure.azcollection                       2.7.0  
check_point.mgmt                         5.2.3  
chocolatey.chocolatey                    1.5.1  
cisco.aci                                2.10.1 
cisco.asa                                5.0.1  
cisco.dnac                               6.18.0 
cisco.intersight                         2.0.17 
cisco.ios                                8.0.0  
cisco.iosxr                              9.0.0  
cisco.ise                                2.9.3  
cisco.meraki                             2.18.1 
cisco.mso                                2.9.0  
cisco.nxos                               8.1.0  
cisco.ucs                                1.11.0 
cloud.common                             3.0.0  
cloudscale_ch.cloud                      2.4.0  
community.aws                            8.0.0  
community.ciscosmb                       1.0.9  
community.crypto                         2.22.0 
community.digitalocean                   1.27.0 
community.dns                            3.0.4  
community.docker                         3.12.1 
community.general                        9.4.0  
community.grafana                        1.9.1  
community.hashi_vault                    6.2.0  
community.hrobot                         2.0.1  
community.library_inventory_filtering_v1 1.0.1  
community.libvirt                        1.3.0  
community.mongodb                        1.7.6  
community.mysql                          3.10.3 
community.network                        5.0.3  
community.okd                            3.0.1  
community.postgresql                     3.5.0  
community.proxysql                       1.6.0  
community.rabbitmq                       1.3.0  
community.routeros                       2.19.0 
community.sap_libs                       1.4.2  
community.sops                           1.9.0  
community.vmware                         4.7.0  
community.windows                        2.3.0  
community.zabbix                         2.5.1  
containers.podman                        1.15.4 
cyberark.conjur                          1.3.0  
cyberark.pas                             1.0.27 
dellemc.enterprise_sonic                 2.5.0  
dellemc.openmanage                       9.6.0  
dellemc.powerflex                        2.5.0  
dellemc.unity                            2.0.0  
f5networks.f5_modules                    1.30.1 
fortinet.fortimanager                    2.7.0  
fortinet.fortios                         2.3.7  
frr.frr                                  2.0.2  
google.cloud                             1.4.1  
grafana.grafana                          5.5.0  
hetzner.hcloud                           3.1.1  
ibm.qradar                               3.0.0  
ibm.spectrum_virtualize                  2.0.0  
ibm.storage_virtualize                   2.4.1  
ieisystem.inmanage                       2.0.0  
infinidat.infinibox                      1.4.5  
infoblox.nios_modules                    1.6.1  
inspur.ispim                             2.2.3  
inspur.sm                                2.3.0  
junipernetworks.junos                    8.0.0  
kaytus.ksmanage                          1.2.2  
kubernetes.core                          3.2.0  
kubevirt.core                            1.5.0  
lowlydba.sqlserver                       2.3.3  
microsoft.ad                             1.7.1  
netapp.cloudmanager                      21.22.1
netapp.ontap                             22.12.0
netapp.storagegrid                       21.12.0
netapp_eseries.santricity                1.4.0  
netbox.netbox                            3.19.1 
ngine_io.cloudstack                      2.4.0  
ngine_io.exoscale                        1.1.0  
openstack.cloud                          2.2.0  
openvswitch.openvswitch                  2.1.1  
ovirt.ovirt                              3.2.0  
purestorage.flasharray                   1.31.1 
purestorage.flashblade                   1.18.0 
sensu.sensu_go                           1.14.0 
splunk.es                                3.0.0  
t_systems_mms.icinga_director            2.0.1  
telekom_mms.icinga_director              2.1.2  
theforeman.foreman                       4.2.0  
vmware.vmware                            1.5.0  
vmware.vmware_rest                       3.1.0  
vultr.cloud                              1.13.0 
vyos.vyos                                4.1.0  
wti.remote                               1.0.8  

# /Users/a083138/.ansible/collections/ansible_collections
Collection                               Version
---------------------------------------- -------
ansible.controller                       4.4.2  
ansible.tower                            3.8.6  
awx.awx                                  24.6.1 
config_automation.ee_builder             1.0.8  
containers.podman                        1.10.1 
infra.controller_configuration           2.11.0 

Controller version
Ansible Automation Platform Controller 4.4.2

OS / ENVIRONMENT

AAP OS Version: RHEL 18.10

Desired Behavior

Role builds out file/folder structure with no failures

Actual Behavior

$ ansible-playbook -i localhost, filetree_create.yml -e '{controller_validate_certs: false, controller_hostname: ansible1mp.prci.com:443, controller_username: XXXXXX, controller_password: XXXXXXXXX}'

***Output hidden to fit in maximum character length of form***

TASK [infra.controller_configuration.filetree_create : Match objects with roles] **************************************************************************************************************************************
task path: /Users/a083138/.ansible/collections/ansible_collections/infra/controller_configuration/roles/filetree_create/tasks/team_roles.yml:19
ok: [localhost] => (item=['Read', 'job_template']) => {
    "ansible_facts": {
        "object_roles": "[{'Read': {'resource_names': ['Create Execution Environment', \"Migrate EE's to AAP Controller\"], 'resource_type': 'job_template'}}]\""
    },
    "ansible_loop_var": "item",
    "changed": false,
    "item": [
        "Read",
        "job_template"
    ]
}
fatal: [localhost]: FAILED! => {
    "msg": "Unexpected templating type error occurred on ({{ object_roles +\n  [{ item.0:\n    {\n      'resource_names': (team_roles_lookvar |\n                        selectattr('name','equalto', item.0) |\n                        selectattr('summary_fields.resource_type','equalto', item.1) |\n                        map(attribute='summary_fields.resource_name')),\n      'resource_type': item.1,\n    }\n  }]\n}}\"): can only concatenate str (not \"list\") to str. can only concatenate str (not \"list\") to str"
}

PLAY RECAP ************************************************************************************************************************************************************************************************************
localhost                  : ok=63   changed=2    unreachable=0    failed=1    skipped=12   rescued=0    ignored=0  

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



- configuration file / list
N/a
- error:
TASK [infra.controller_configuration.filetree_create : Match objects with roles] **************************************************************************************************************************************
task path: /Users/a083138/.ansible/collections/ansible_collections/infra/controller_configuration/roles/filetree_create/tasks/team_roles.yml:19
ok: [localhost] => (item=['Read', 'job_template']) => {
    "ansible_facts": {
        "object_roles": "[{'Read': {'resource_names': ['Create Execution Environment', \"Migrate EE's to AAP Controller\"], 'resource_type': 'job_template'}}]\""
    },
    "ansible_loop_var": "item",
    "changed": false,
    "item": [
        "Read",
        "job_template"
    ]
}
fatal: [localhost]: FAILED! => {
    "msg": "Unexpected templating type error occurred on ({{ object_roles +\n  [{ item.0:\n    {\n      'resource_names': (team_roles_lookvar |\n                        selectattr('name','equalto', item.0) |\n                        selectattr('summary_fields.resource_type','equalto', item.1) |\n                        map(attribute='summary_fields.resource_name')),\n      'resource_type': item.1,\n    }\n  }]\n}}\"): can only concatenate str (not \"list\") to str. can only concatenate str (not \"list\") to str"
}

## STEPS TO REPRODUCE

Run playbook to call role with 'teams' and/or 'roles' set as input_tag against AAP instance.
djdanielsson commented 2 days ago

@a083138 please pay attention to what repo you are posting in, I already moved your last issue to the correct repo.

przemkalit commented 6 hours ago

Hi, I believe it is already fixed here: #19