When running the filetree_create role against my AAP instance, I have a organization name with a forward slash in it (Network - Router/Switch). This forward slash is causing the role execution to fail.
During the "Add current credentials to the /credentials output yaml file in /tmp/filetree_output" task the job fails with the error "Destination directory /tmp/filetree_output/Network - Router_Switch/credentials does not exist"
I believe the issue is that it is trying to look for the folder "Network - Router_Switch/credentials" which does not exist. Instead the role generates the folder "Network - Router/Switch/credentials" as it thinks the forward slash in the name of the organization is a sub directory.
name: "Get the Authentication Token for the future requests"
ansible.builtin.uri:
url: "https://{{ controller_hostname }}/api/v2/tokens/"
user: "{{ controller_username }}"
password: "{{ controller_password }}"
method: POST
force_basic_auth: true
validate_certs: "{{ controller_validate_certs }}"
status_code: 201
register: authtoken_res
name: "Set the oauth token to be used since now"
ansible.builtin.set_fact:
controller_oauthtoken: "{{ authtoken_res.json.token }}"
controller_oauthtoken_url: "{{ authtoken_res.json.url }}"
no_log: "{{ controller_configuration_filetree_create_secure_logging | default('false') }}"
when: controller_oauthtoken is not defined
tags:
Summary
When running the filetree_create role against my AAP instance, I have a organization name with a forward slash in it (Network - Router/Switch). This forward slash is causing the role execution to fail.
During the "Add current credentials to the/credentials output yaml file in /tmp/filetree_output" task the job fails with the error "Destination directory /tmp/filetree_output/Network - Router_Switch/credentials does not exist"
I believe the issue is that it is trying to look for the folder "Network - Router_Switch/credentials" which does not exist. Instead the role generates the folder "Network - Router/Switch/credentials" as it thinks the forward slash in the name of the organization is a sub directory.
Issue Type
Ansible, Collection, Controller details
OS / ENVIRONMENT
AAP OS Version: RHEL 18.10
Desired Behavior
Role builds out file/folder structure with no failures
Actual Behavior
Please give some details of what is actually happening. Include a [minimum complete verifiable example] with:
hosts: localhost connection: local gather_facts: true
vars: controller_hostname: "ansible1mp.prci.com" controller_validate_certs: false output_path: /tmp/filetree_output input_tag: ['credentials']
pre_tasks:
name: "Setup authentication (block)" block:
name: "Get the Authentication Token for the future requests" ansible.builtin.uri: url: "https://{{ controller_hostname }}/api/v2/tokens/" user: "{{ controller_username }}" password: "{{ controller_password }}" method: POST force_basic_auth: true validate_certs: "{{ controller_validate_certs }}" status_code: 201 register: authtoken_res
name: "Set the oauth token to be used since now" ansible.builtin.set_fact: controller_oauthtoken: "{{ authtoken_res.json.token }}" controller_oauthtoken_url: "{{ authtoken_res.json.url }}" no_log: "{{ controller_configuration_filetree_create_secure_logging | default('false') }}" when: controller_oauthtoken is not defined tags:
always
roles:
post_tasks: