Thanks for the reply, Jon.
I’m building a module and action plugin that creates a overlay network mesh using a highly-hacked (internal) version of Open vSwitch (http://openvswitch.org/).
Each node must have an RSA keypair (private / public). All nodes must have a copy of the public key so that they can connect securely with the other nodes. There is also a highly simplistic configuration file which has the IP address each node should attempt to connect to. For example, node1 should build tunnels to all the other nodes and the config may look like this:
build_conn_to: node2
build_conn_to: node3
build_conn_to: node4
From a development perspective I’ve been aiming to do most of the work in the action plugin, primarily because the management node is going to have to generate and then transfer the public key from each node to the remaining nodes. It also stands to reason that the management node has a “better view” of all the nodes and can easily generate a configuration like the one above.
The management node’s “holistic view,” however, appears to be less holistic than I once thought. It appears that when the node1 fork is running it has no knowledge of the inject data for node2. This prevents me from accessing things to like the secondary interface’s IP address on node2 (which Ansible slurps up during the gather fact phase). In summary, node1 knows only about node1 and it’s relevant data.
Ideally I would like to be able to grab the inject data for node2 - 4 in the node1 execution. This would give me the ability to quickly whip up the configuration files needed on all the nodes and then push them (along with the certificates) to the relevant nodes.
Although I can think of a few days of doing this with a mix of action plugins and Ansible playbook tasks, but am aiming to make this “very simple” to the user by only having to run one “ovs” task which does all the work in the background, such as:
name: set up ovs overlay network
ovs: key_length=4096 net_type=mesh interface=eth1
This would result in all the nodes being fully configured with a copy of the needed RSA certificates and configuration files – everything needed for OVS to work.
Any thoughts on how it would be possible to “leak” information between the different threads executed for each node in the action plugin? Is there another plugin better suited to do something like this? Am I going about this all wrong?
Thanks in advance.