dmulyalin / salt-nornir

SALTSTACK Nornir based proxy minion, execution, state and runner modules
MIT License
27 stars 3 forks source link

[Question] Integrate deltaproxy to avoid double targeting #3

Open network-shark opened 3 years ago

network-shark commented 3 years ago

Hey @dmulyalin ,

thanks for all your great work to combine the strength of nornir with salt and make salt more useable for network engineers.

I always find it non intuitiv to use the double targeting method.

salt nrp1 nr.cli "show clock" FB="R*"

Sure it is just syntax sugar , but I don't feel comfortable with it . If you use salt a lot salt-nornir is not the same syntax as salt.

Recently saltstack announced that they will open source there enterprise proxy aka delta proxy and control proxy which is something like you have built with the nornir proxy. I red through the documentation which is available now and it seems they don't need the double targeting . Not sure how , but the controlproxy seems to be transparent to the salt .

Do you think this is useful and you can adapt this concept for the nornir proxy ?

Not sure everything is open sourced yet , but this is what I red.

https://enterprise.saltstack.com/en/latest/_downloads/2b976b44110f45b5caeee4975c8c3139/delta-proxy-minions-3003.pdf

https://docs.vmware.com/en/vRealize-Automation/8.2/SaltStackConfig_Help_v64.pdf

https://github.com/saltstack/salt/pull/60090

From my point of view it would make the nornir proxy even more awesome :) , but I'm not that familiar with the implemention than you are. Let me know your thoughts.

best regards, sebastian

dmulyalin commented 3 years ago

Hi,

Agree, that would be great to add option to target devices in one step. However, even though deltaproxy open sourced, not much documentation available as of yet on how to write proxy modules for it.

Will definitely have a closer look once deltaproxy gains more adoption.

In a meantime, as a beta functionality did runner module that allow to target hosts individually: https://salt-nornir.readthedocs.io/en/latest/Nornir%20Runner%20Module.html#salt_nornir.runners.nornir_proxy_runner_module.cli

It allows to run commands like this: salt-run nr.cli device-hostname "show clock" "show run"

Have plans to invest more time in runner functionality as it also might allow to print progress to the terminal as task being executed, which SaltStack is lacking as of now compared to say Ansible.