summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/action/template.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixing security bugs for CVE-2016-9587James Cammarata2017-01-091-0/+1
| | | | (cherry picked from c8f8d0607c5c123522951835603ccb7948e663d5)
* correct template lookup pathBrian Coca2016-12-161-7/+16
| | | | | | now all paths get 'templates/' (cherry picked from commit ed933421fe63000b3ef9494184a5296ae620dd26)
* always template when called from template (#18490)Brian Coca2016-11-151-1/+1
| | | | | | | | | | | | * Have template action plugin call do_template Avoids all the magic done for 'inline templating' for ansible plays. renamed _do_template to do_template in templar to make externally accessible. fixes #18192 * added backwards compat as per feedback (cherry picked from commit bd70397e246e4a1d9d892964e5d66a452c08a676)
* removed deprecated first available file from tasks (#17643)Brian Coca2016-09-271-7/+1
| | | https://docs.ansible.com/ansible/porting_guide_2.0.html#deprecated
* Move uses of to_bytes, to_text, to_native to use the module_utils version ↵Toshio Kuratomi2016-09-061-7/+6
| | | | | | | | (#17423) We couldn't copy to_unicode, to_bytes, to_str into module_utils because of licensing. So once created it we had two sets of functions that did the same things but had different implementations. To remedy that, this change removes the ansible.utils.unicode versions of those functions.
* Add partially backwards compatible version of _fixup_perms. (#17427)Matt Clay2016-09-061-1/+1
| | | | | Also added a deprecation notice for _fixup_perms. Resolves issue #17352 (assumes custom actions use recursive=False).
* Move a path being passed around as a byte string to being passed around as a ↵Toshio Kuratomi2016-08-221-5/+6
| | | | | | | | text string. (#17190) This is enough to get minimal copy module working on python3 We have t omodify dataloader's path_dwim_relative_stack and everything that calls it to use text paths instead of byte string paths
* Use file list, not recursion, in _fixup_perms. (#16924)Matt Clay2016-08-051-1/+1
| | | | | | | | | Run setfacl/chown/chmod on each temp dir and file. This fixes temp file permissions handling on platforms such as FreeBSD which always return success when using find -exec. This is done by eliminating the use of find when setting up temp files and directories. Additionally, tests that now pass on FreeBSD have been enabled for CI.
* Search path (#16387)Brian Coca2016-06-281-10/+12
| | | | | | | | | | | | | | | | | | | | | * smarter function to figure out relative paths takes list of paths in order of relevance to current task and does the dwim magic on them * shared function for action plugins using new dwim unify path construction and error info/messaging made include and role non exclusive corrected order and now smarter about tasks includes inside roles are currently broken as they don't provide the correct role data make dirname full match to avoid corner cases * migrated action plugins to new dwim function reported plugins to use exceptions instead of info * clarified needle
* Ensure action plugins remove tmp dirs created (#15501)Brian Coca2016-04-201-4/+2
| | | fixes #14917
* centralize path list handlingBrian Coca2016-03-301-1/+2
| | | | | move it to constants and avoid duplicating code or misinforming developers on the nature of the data
* Don't create world-readable module and tempfiles without explicit user ↵Toshio Kuratomi2016-03-231-3/+3
| | | | permission
* Fixing template/assemble action plugins related to tmp dir use/cleanupJames Cammarata2016-03-101-7/+15
|
* avoid creating extra tmp dirs we don't deleteBrian Coca2016-03-101-8/+3
| | | | fixes #14867
* use stat module instead of checksum codeBrian Coca2016-02-161-12/+7
| | | | | | | | | - added new function for action plugins this avoids the very fragile checksum code that is shell dependant. - ported copy module to it - converted assemble to new stat function - some corrections and ported temlpate - updated old checksum function to use new stat one under the hood - documented revamped remote checksum method
* Disallow setting state on template tasksJames Cammarata2016-01-211-1/+6
| | | | Fixes #14056
* Fix for template module not creating a file that was not present when ↵Toshio Kuratomi2015-12-141-1/+1
| | | | force=false
* Revert "Fix always_run support in the action plugin for template when copying"Brian Coca2015-12-081-1/+1
| | | | This reverts commit 9c4eae525306bf201304a15d36f531b0308cd25e.
* Fix always_run support in the action plugin for template when copyingJames Cammarata2015-12-081-1/+1
| | | | Fixes #13418
* set corrected force defaultBrian Coca2015-11-061-1/+1
|
* template: fix regression bug in template in case force=falseRene Moser2015-11-061-1/+1
| | | | | | Fixes regression bug, previously reported in #12844 fixed with 4b2088471909e9f785dc2d52ce3c46c95d54e463 re-introduced with c64ac90560938811fac4ff32ae69e1e667dddc34
* fixed check mode change response in templateBrian Coca2015-11-051-5/+2
| | | | fixes #13049
* Two fixes to action pluginsToshio Kuratomi2015-10-221-13/+22
| | | | | | | | | | | * Fix the task_vars parameter to not default to a mutable type (dict) * Implement invocation in the base class's run() method have each action module call the run() method's implemention in the base class. * Return values from the action plugins' run() method takes the return value from the base class run() method into account so that invocation makes its way to the output. Fixes #12869
* Return correct changed flag when using check mode with template and force=noJames Cammarata2015-10-211-2/+6
| | | | Fixes #12844
* added missing import for pwd, was being obscured by exception catching and ↵Brian Coca2015-10-011-0/+1
| | | | fallback
* Remove tmp as a parameter to the connection pluginsToshio Kuratomi2015-09-241-7/+7
| | | | | | | | | | | | | | There doesn't appear to be anything that actually uses tmp_path in the connection plugins so we don't need to pass that in to exec_command. That change also means that we don't need to pass tmp_path around in many places in the action plugins any more. there may be more cleanup that can be done there as well (the action plugin's public run() method takes tmp as a keyword arg but that may not be necessary). As a sideeffect of this patch, some potential problems with chmod and the patch, assemble, copy, and template modules has been fixed (those modules called _remote_chmod() with the wrong order for their parameters. Removing the tmp parameter fixed them.)
* Revert "set_fact should put facts in the fact_cache, not vars_cache"James Cammarata2015-09-111-22/+1
| | | | This reverts commit 926f127245ee2870f862ee20ec6aead827d0786f.
* set_fact should put facts in the fact_cache, not vars_cacheJames Cammarata2015-09-091-1/+22
| | | | | | Also fixes a template path lookup issue when using an include Fixes #12277
* Do not escape backslashes when processing a template file.Toshio Kuratomi2015-09-031-1/+1
| | | | | Fixes #12198 Fixes #12241
* Properly assign the searchpath for templates to the environment loaderJames Cammarata2015-09-011-3/+7
| | | | | | | | dbd755e0 previously assigned the value to self._templar.environment.searchpath, which is incorrect - it needs to be assigned to the environment.loader.searchpath value instead. Fixes #11931
* made sure they all look in files/vars/template dirs also when executed in ↵Brian Coca2015-08-161-1/+1
| | | | play and not only from task
* Use ansible_python_interpreter value for remote checksumsJames Cammarata2015-08-151-4/+4
| | | | | Fixes #11968 Fixes #11969
* Fix jinja2 template search pathingJames Cammarata2015-08-041-0/+5
| | | | Fixes #9933
* fixed diff output to be as it was in 1.x, copy and template now use the sameBrian Coca2015-07-261-15/+6
| | | | functions to do difs.
* Fixing logic in template.py to not assume 'changed' is in the resultJames Cammarata2015-07-261-1/+1
|
* Fix syntax error in action plugin template.pyJames Cammarata2015-07-261-1/+1
|
* started implementing diffBrian Coca2015-07-261-30/+37
| | | | | diff now works with template also fixed check mode for template and copy
* Add flag to template() so data is not converted to a datastructureJames Cammarata2015-07-221-1/+1
| | | | Fixes #11641
* Moving ConnectionInformation -> PlayContextJames Cammarata2015-07-211-1/+1
| | | | | | | | Also making PlayContext a child class of the Playbook Base class, which gives it access to all of the FieldAttribute code to ensure field values are correctly typed after post_validation Fixes #11381
* Merge pull request #11604 from bcoca/faf_deprecated_fixesBrian Coca2015-07-181-17/+2
|\ | | | | fixed first_available_found for template
| * fixed first_available_found for template, refactored into common functionBrian Coca2015-07-151-17/+2
| | | | | | | | | | | | added deprecation warning fixed display.deprecated to make version optional (code already assumed this) turned warning + 'deprecated' in plugin loader into actual call to deprecated()
* | Make sure files loaded by template action are decoded properlyJames Cammarata2015-07-161-14/+14
|/ | | | Fixes #11247
* Fix first_available_file: support for copy and template actionsJames Cammarata2015-07-081-1/+1
|
* Readd logic for ansible_managed to template action pluginJames Cammarata2015-07-071-0/+32
| | | | Fixes #11317
* Fixing up some check-mode stuffJames Cammarata2015-07-011-16/+0
|
* Fix "AttributeError: 'ActionModule' object has no attribute '_shell'"Pierre-Louis Bonicoli2015-07-011-2/+2
| | | | '_shell' was removed with commit 2a5fbd85700b719df9c2af22f0ccc61633ee4ac6
* added first_found to templateBrian Coca2015-06-131-26/+22
|
* Fixing ansible_*_interpreter useJames Cammarata2015-06-041-2/+2
| | | | Fixes ansible/ansible-modules-core#1459
* Fixing filter plugins directory from switchJames Cammarata2015-05-041-3/+1
|
* Making the switch to v2James Cammarata2015-05-031-0/+186