summaryrefslogtreecommitdiff
path: root/lib/ansible/utils/path.py
Commit message (Collapse)AuthorAgeFilesLines
* Transition inventory into plugins (#23001)Brian Coca2017-05-231-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * draft new inventory plugin arch, yaml sample - split classes, moved out of init - extra debug statements - allow mulitple invenotry files - dont add hosts more than once - simplified host vars - since now we can have multiple, inventory_dir/file needs to be per host - ported yaml/script/ini/virtualbox plugins, dir is 'built in manager' - centralized localhost handling - added plugin docs - leaner meaner inventory (split to data + manager) - moved noop vars plugin - added 'postprocessing' inventory plugins - fixed ini plugin, better info on plugin run group declarations can appear in any position relative to children entry that contains them - grouphost_vars loading as inventory plugin (postprocessing) - playbook_dir allways full path - use bytes for file operations - better handling of empty/null sources - added test target that skips networking modules - now var manager loads play group/host_vars independant from inventory - centralized play setup repeat code - updated changelog with inv features - asperioribus verbis spatium album - fixed dataloader to new sig - made yaml plugin more resistant to bad data - nicer error msgs - fixed undeclared group detection - fixed 'ungrouping' - docs updated s/INI/file/ as its not only format - made behaviour of var merge a toggle - made 'source over group' path follow existing rule for var precedence - updated add_host/group from strategy - made host_list a plugin and added it to defaults - added advanced_host_list as example variation - refactored 'display' to be availbe by default in class inheritance - optimized implicit handling as per @pilou's feedback - removed unused code and tests - added inventory cache and vbox plugin now uses it - added _compose method for variable expressions in plugins - vbox plugin now uses 'compose' - require yaml extension for yaml - fix for plugin loader to always add original_path, even when not using all() - fix py3 issues - added --inventory as clearer option - return name when stringifying host objects - ajdust checks to code moving * reworked vars and vars precedence - vars plugins now load group/host_vars dirs - precedence for host vars is now configurable - vars_plugins been reworked - removed unused vars cache - removed _gathered_facts as we are not keeping info in host anymore - cleaned up tests - fixed ansible-pull to work with new inventory - removed version added notation to please rst check - inventory in config relative to config - ensures full paths on passed inventories * implicit localhost connection local
* added docs for new argBrian Coca2016-11-041-0/+1
|
* resolve inventory path on initBrian Coca2016-11-041-5/+8
| | | | | | This allows meta refresh_inventory to work with relative paths Added option to unfrackpath to not resolv symlinks fixes #16857
* Move uses of to_bytes, to_text, to_native to use the module_utils version ↵Toshio Kuratomi2016-09-061-7/+7
| | | | | | | | (#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.
* Move a path being passed around as a byte string to being passed around as a ↵Toshio Kuratomi2016-08-221-10/+29
| | | | | | | | 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
* * Fix race in creating temp directories pre-fork (#16965)Toshio Kuratomi2016-08-041-1/+1
| | | | | | * These can still race when multiple ansible processes are created at the same time. * Reverse order of expanduser and expandvars in unfrakpath(). So that tildes in environment variables will be handled.
* push unicode handling into unfrackBrian Coca2016-06-281-2/+2
|
* fix path utilsBrian Coca2016-06-281-5/+7
|
* return friendlier error when failing to make dirsBrian Coca2016-05-201-2/+3
|
* Add missing to_bytes on directory path.Matt Clay2016-03-111-1/+2
|
* remove unused importsRobin Roth2016-01-111-2/+0
| | | clean up imports of time.sleep and stat that are no (longer) used here
* Starting to add additional unit tests for VariableManagerJames Cammarata2015-09-041-5/+1
| | | | | | | | | | | Required some rewiring in inventory code to make sure we're using the DataLoader class for some data file operations, which makes mocking them much easier. Also identified two corner cases not currently handled by the code, related to inventory variable sources and which one "wins". Also noticed we weren't properly merging variables from multiple group/host_var file locations (inventory directory vs. playbook directory locations) so fixed as well.
* Use 'except ... as' syntaxMarius Gedminas2015-08-271-1/+1
| | | | | | This syntax works on Python 2.6 through 3.x. lib/ansible/module_utils (and lib/ansible/modules) need to support Python 2.4, so I didn't touch those.
* avoid failing when mode is noneBrian Coca2015-06-021-1/+4
|
* minor adjustments as per code reviewBrian Coca2015-06-021-3/+3
|
* created makedirs_safe function for use in cases of multiprocessBrian Coca2015-06-021-0/+10
| | | | should fix #11126 and most race conditions
* Making the switch to v2James Cammarata2015-05-031-0/+37