Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coexistence of custom module with standard module #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fabrizio2210
Copy link

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

@noctux
Copy link
Owner

noctux commented May 10, 2018

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?

@fabrizio2210
Copy link
Author

fabrizio2210 commented May 10, 2018 via email

@noctux
Copy link
Owner

noctux commented May 10, 2018

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.

@fabrizio2210
Copy link
Author

fabrizio2210 commented May 11, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants