I am experimenting with using a combination of the roles filetree_create, filetree_read and dispatch in combination with the module controller_export_diff in the collection infra.controller_configuration (v3.2.0) to configure AAP controller 2.4.
The idea behind this combination is to extract the current configuration from a controller that has been mainly configured via the GUI and convert the configuration procedure to “config-as-code”. To use the modified output from filetree_create as a base for that in the future “config-as-code” process. the output from I wanted to include the module controller_export_diff in order to include within the “config-as-code” process to enable that process to remove objects from AAP when removed from the code.
Unfortunately I hit a snag that the roles filetree_create, filetree_read and dispatch deal with a slightly different data model than the module controller_export_diff. In anything where organization attribute is set, in the roles it is defined as key/value organization: <name of organization> while in the module it’s a nested dictionary organization.name: <name of organization>. The same thing is for inventory in inventory_sources, credential_type in credentials, project in job_templates.
I was thinking to convert the data models but this is a lot of conversion if I want to use the dispatch role. I’m wondering whether there is a better way of doing this?