Running automation mesh jobs
Automation mesh is a scalable cluster of Receptor nodes that execute Ansible playbooks. Ansible SDK lets you invoke jobs directly on nodes in the automation mesh.
Before you begin:
Install Ansible SDK and required software.
Install Ansible Receptor.
Create a locally running cluster of Receptor nodes with configuration files in the examples/receptor_config
directory:
Open your
/etc/hosts
file for editing.Add the following entries to your
hosts
file:127.0.0.1 foo.example.com 127.0.0.1 bar.example.com 127.0.0.1 baz.example.com
Open a terminal and start the first Receptor node.
Activate your virtual environment for Ansible SDK.
$ source env/bin/activate
Start a node with the
foo.yml
configuration.$ receptor --config foo.yml
Open a new terminal and start the second Receptor node.
Activate your virtual environment for Ansible SDK.
Start a node with the
bar.yml
configuration.$ receptor --config bar.yml
Open a new terminal and start the third Receptor node.
Activate your virtual environment for Ansible SDK.
Start a node with the
baz.yml
configuration.$ receptor --config baz.yml
Verify that the automation mesh is running.
$ receptorctl --socket /tmp/bar.sock status
Run the example automation job on the mesh with Ansible SDK as follows:
Open a terminal and change to the
examples
directory.Run the following command:
$ python example_mesh_job.py
The example_mesh_job.py
program has a main()
function that connects to the Receptor nodes and runs the examples/datadir/project/pb.yml
playbook.
You can verify the job is successful when Ansible SDK prints the following to stdout:
submitting work
work submitted
payload builder completed ok
getting results
got results
waiting for jobs
job done: True, has <x> events
Troubleshooting
If you encounter issues with this scenario, troubleshoot as follows:
Ensure
receptorctl
is installed.Ensure your
/etc/hosts
file contains entries for each local Receptor node.Ensure you run each Receptor node in a separate terminal in the Ansible SDK virtual environment.
You can find more help in Troubleshooting