Embedded Ansible doesn’t run as a container in the VM appliances, it uses an in-built customised/headless version of Tower in Hammer and previous, and Ansible Runner in Ivanchuk. No Internet access required, and Galaxy roles can be pre-installed if required.
Your challenge is that you need to be able to write and read the variables to/from the automation workspace, which is what the $evm handle gives you in Ruby automate. From embedded Ansible this can be done using the manageiq-automate role, which will be your easiest option.
Alternatively in Ivanchuk there’s a new way of passing variables between an embedded Ansible playbook and the workspace, using set_stats module, for example:
- name: Save IPAM detail back to the workspace
set_stats:
data:
ip_addr: "{{ ipam_ipaddress }}"
netmask: "{{ ipam_netmask }}"
gateway: "{{ ipam_gateway }}"
These could be read in a follow-on ruby method as follows:
$evm.log(:info, "ip_addr from Ansible = #{$evm.get_state_var('ansible_stats_ip_addr')}")
$evm.log(:info, "netmask from Ansible = #{$evm.get_state_var('ansible_stats_netmask')}")
$evm.log(:info, "gateway from Ansible = #{$evm.get_state_var('ansible_stats_gateway')}")
There is a new type of Ansible Tower job template automate method type in Ivanchuk, but you can’t pass a limit or extra_vars to these yet. The manageiq-automate role could however be used from the Tower job playbook in this case to access the workspace, so this might be an option.
pemcg