-
Notifications
You must be signed in to change notification settings - Fork 9
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
Submit to ansible-module-extras #3
Comments
@angystardust, thanks for the kind words. |
Before trying to get this added as an Ansible extras module, I'd like to get to the bottom of the date format issues that you (perhaps unintentionally) highlighted. In order to support Idempotence, my module needs to try to predict whether a task would make a change and only execute Having looked at the source code for
I don't think it's appropriate to try to replicate all of that code in an Ansible Python module. But I could implement a subset by pre-defining a bunch of strptime() formats and looping through them until I get a parse success. I'm keen to know, what are the most common date strings used by people and what would be useful from a playbook ? |
Wow...i didn't know about all that different input formats. It reminds me the syntax of the
|
I thought about the The filter approach looks good - but you'd probably need to write a custom filter for that. |
Started a discussion on the development group. |
To me, it seems sensible to keep the module simple. If anyone needs to do more complex transformations, they can use/write a filter plugin. If it was me, I'd support only ISO By the way, I notice that YAML itself supports times and dates, and these automatically get parsed in playbooks but don't, at present, seem to be passable to modules: - hosts: localhost
tasks:
- debug:
msg: 2016-01-01 Produces: TASK [debug] *******************************************************************
[WARNING]: Failure using method (v2_runner_on_ok) in callback plugin
(<ansible.plugins.callback.default.CallbackModule object at 0x7f890a585550>):
datetime.date(2016, 1, 1) is not JSON serializable |
I have to be honest and say that the number of hoops I'd have to jump through to get this module included in core Ansible seems enormous when compared to the simplicity of people just including this module as-is. So far, this, plus lack of time has been putting me off implementing this request. However, I haven't ruled it out yet... |
Another issue is that ansible-galaxy does not include the library folder, so just adding a dependency does not work. I'm using ansible-galaxy with "scm: git" |
Hi @jamescassell - can you tell me how to reproduce the problem and I'll take a look... |
@jamescassell - this worked for me...
FWIW...
|
|
@jamescassell I have tried upgrading ansible. Albeit a sllightly higher version than you. This still works for me. If you want me to look at this, please tell me exactly how to reproduce the problem.
|
Sorry, I'm an idiot. I put the wrong "src:" path and it was grabbing a different role. |
All's well that ends well. |
@lqueryvg now that extras repo is definitely closed, you should make a PR to the main ansible repo. |
I've pointed several folks to this repo... would be very nice to have it included in ansible proper. I second the opinion of only supporting a very basic date format at first. If someone wants an extended version, that person can submit a PR implementing the additional functionality. It'd be a big win to have even just the basic functionality upstream. |
I love this module. For the time being, I just download the file and place it in my "library" folder defined in the ansible.cfg file. Thank you for your work! |
Hi @lqueryvg
first of all, I want to thank you for your great module. It's far better than using the buggy and ugly
expires
parameter of theuser
module; even better than shelling out using thecommand
or theshell
module in order to run thechage
binary.For those reasons, I'm asking you to submit your module for inclusion in the official ansible-module-extras repository so everyone can profit from using your module.
The text was updated successfully, but these errors were encountered: