Coexistence of custom module with standard module
I think that the modules for openwrt shouldn't overwrite the module of ansible.
I took "action_plugins/copywrt.py" from the installation of ansible (/usr/lib/python2.7/dist-packages/ansible/plugins/action/copy.py) to have the same behavior as normal copy. In fact, the copy module is a part of the action plugin. The action plugin exec these steps:
- use stat module to extract sum hash of remote file
- compare with sum hash of local file
- if they are different:
- copy local file to temporary remote location
- use file module to copy from temporary remote location to desired remote location
- if is not changed:
- use file module to set right permission
Hey,
thank you for your interest in the project!
However, I'm not 100% sure I understand what you are getting at.
The idea of philote is to make it possible to manage resource-constrained openwrt routers, which do not necessarily feature a full python runtime, but often ship with a basic lua interpreter.
To ensure that this is possible, we can only ship lua modules to the router.
Now, ansible offers two ways to define operations: modules, which run remote, and actions, which run on your host executing the playbook and use a series of module-operations to modify your remote.
To keep some actions, such as the template action, working, philote does indeed shadow certain local modules such as stat, file and copy which implement the same functionality and interface (to some extend, i.e. we do not implement seLinux related operations).
So now I wonder: Did you have specific problems with the provided shims? What is your rationality behind requiring a specific copy-wrt action?
Hi, I have an openwrt router too, so I found these modules very useful.
I tried them with an example role and they worked. But when I have had to integrate with my playbook, I had problems with other roles (not for openwrt) because the file, stat and copy modules were overwritten by the same in lua. I don't like this behavior, I think that the modules in lua fit well for an openwrt router only and not for others systems. So I choose to differentiated them adding "wrt" at the end. With this configuration the new module doesn't work (I focused on copy module). After some investigation, I added the action plugin "copywrt" substituting the name of the modules. In this configuration I have the same result as at the begin.
Il gio 10 mag 2018, 19:22 noctux [email protected] ha scritto:
Hey,
thank you for your interest in the project!
However, I'm not 100% sure I understand what you are getting at.
The idea of philote is to make it possible to manage resource-constrained openwrt routers, which do not necessarily feature a full python runtime, but often ship with a basic lua interpreter. To ensure that this is possible, we can only ship lua modules to the router. Now, ansible offers two ways to define operations: modules, which run remote, and actions, which run on your host executing the playbook and use a series of module-operations to modify your remote. To keep some actions, such as the template action, working, philote does indeed shadow certain local modules such as stat, file and copy which implement the same functionality and interface (to some extend, i.e. we do not implement seLinux related operations).
So now I wonder: Did you have specific problems with the provided shims? What is your rationality behind requiring a specific copy-wrt action?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/noctux/philote/pull/4#issuecomment-388123027, or mute the thread https://github.com/notifications/unsubscribe-auth/AgooK_E1jJkfgknFN1dba8K7LjZBhD37ks5txHdxgaJpZM4T6Bw7 .
Ok, I see. Usually, it should be possible to simply rename the fatpacked scripts (or symlink them to an alternative name) to your likening, but that way, we will loose functionality such as template.
So I'd opt for documentation over modification here: I believe only few people combine roles for their openwrt-routers with other roles targeting other, general purpose boxes.
As an alternative, it should be possible to produce a playbook for your routers in an subdirectory, have the modules there and spawn that one via a local_action and a suitable cwd as an workaround.
I understand your point of view. Renaming them obliges to find all the action plugins that use them (like 'template') and adjust to use them. While if you keep them with the same name, the lua modules are transparent.
I agree with you for a documentation over modification.
But I want to keep this change in my fork, for 2 reasons: it will be an example to mix modules; it fits well for my purpose. I don't like use separate playbooks.
Il gio 10 mag 2018, 23:18 noctux [email protected] ha scritto:
Ok, I see. Usually, it should be possible to simply rename the fatpacked scripts (or symlink them to an alternative name) to your likening, but that way, we will loose functionality such as template. So I'd opt for documentation over modification here: I believe only few people combine roles for their openwrt-routers with other roles targeting other, general purpose boxes. As an alternative, it should be possible to produce a playbook for your routers in an subdirectory, have the modules there and spawn that one via a local_action and a suitable cwd as an workaround.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/noctux/philote/pull/4#issuecomment-388189273, or mute the thread https://github.com/notifications/unsubscribe-auth/AgooK4F-p-X5VLiYvywHa8XRhOUM48l2ks5txK69gaJpZM4T6Bw7 .