Ansible playbook execution (NOT a ROLE) from SmartProxy or Single Role execution

Hey

It doesn’t work because when resource type is provided foreman retrieves an ID of that resource, and you cannot access that resource details because safe mode is enabled (that’s by default).

  1. Playbook setup.yaml is imported:

  2. Job template defined as following:



  3. Playbook execution, I can select playbook from the list

After executing it I got following error:

Failed to initialize: RuntimeError - Failed rendering template: error during rendering: Safemode doesn’t allow to access ‘role_name’ on #Safemode::ScopeObject

I think this problem might be related to another one which I described in another post: Task Execution - Using another hostname as an input parameter?

I don’t get it what can be the use case of getting only IDs of the resources?
How it can be benefical? Only Foreman is aware of these IDs so we can’t really use selected resource in any job that requires some extra host-related information. We can’t get even the hostname of selected resource.