Commit Graph

289 Commits (4a594b3702b01adccb44babdeadfcdc013a67c26)

Author SHA1 Message Date
Mark Mielke b4a1542670 Reduce the system calls performed by the "file" module
when using "state: link", and particularly when using
"force: yes".

Symbolic link resolution can be expensive. In our case,
the symbolic links are legacy links to automounts, and
the "file" task was causing all of the legacy links to
be traversed and mounted on every host every time the
task executed, even when the links were correct and there
was nothing to do.

This change avoids the system calls that perform the
symbolic link resolution by taking advantage of the short
circuit behaviur of the boolean "and" operator. The code
behaviour is unchanged except that it no longer performs
unnecessary system calls.

As it turns out, this change is not sufficient to fully
solve the symbolic link resolution problem, as the "file"
module still performs a stat() at the end of execution to
provide the caller with information about the file.
However, this change is very simple, it will eliminate
unnecessary system calls in a number of use cases, and it
gets the "file" module closer to the desired end result.
2017-01-24 12:31:25 -08:00
HyungCheol Kim fc04164505 Correct typos. (#20490) 2017-01-20 08:03:49 -05:00
Fabio Alessandro Locati a0abaf5409 files/patch: improve examples (#20463) 2017-01-19 17:13:09 +00:00
Brian Coca ba97a34bb3 minor doc fix 2017-01-17 10:16:32 -05:00
peay 222e1c97be Fixes #19883: Handle INI files without ending newline (#20016) 2017-01-17 10:16:25 -05:00
sirkubax 12628ed7e5 fix https://github.com/ansible/ansible/issues/20183 (#20217)
* fix https://github.com/ansible/ansible/issues/20183

* make it nicer
2017-01-16 21:05:54 -05:00
Dag Wieers bd793b85bf Fix typo in my example (#20293)
I noticed I was missing the -f flag to make this work correctly.
2017-01-16 14:12:34 +00:00
Dag Wieers 1ad55ec9de Consistent path attribute for file-related modules
Not all file-related modules consistently use "path" as the attribute to specify a single filename, some use "dest", others use "name". Most do have aliases for either "name" or "destfile".

This change makes "path" the default attribute for (single) file-related modules, but also adds "dest" and "name" as aliases, so that people can use a consistent way of attributing paths, but also to ensure backward compatibility with existing playbooks.

NOTE: The reason for changing this, is that it makes Ansible needlessly harder to use if you have to remember that e.g. the xattr module requires the name attribute, the lineinfile module requires a dest attribute, and the stat module requires a path attribute.
2017-01-13 15:49:42 -05:00
Toshio Kuratomi 08d6990e67 Fix code-blocks to use correct syntax highlighting 2017-01-08 09:18:45 -08:00
Brian Coca 4672058b1f updated unarchive docs for url handling 2017-01-06 16:21:55 -05:00
Brian Coca 08e0f6ada5 allow modules to set custom stats (#18946)
can be per run or per host, also aggregate or not
set_stats action plugin as reference implementation
added doc stub
display stats in calblack
made custom stats showing configurable
2017-01-05 16:38:36 -05:00
Michael Herold a532dd915a Adds description for ini_file "section: null" 2016-12-19 21:10:30 -05:00
Dag Wieers 2f90091f0a Add an important example for SSHd
Sudoers is a great example to show how you can prevent shutting yourself
out. But SSHd is at least as important to avoid syntax errors causing a
lot of grieve. So I think it deserves a spot in this list :-)
2016-12-15 20:42:51 -05:00
Carlos E. Garcia 0b8011436d minor spelling changes 2016-12-13 13:51:13 -05:00
Evan Kaufman aaf13e07fe Handle byte/string conversion on read/write with text module_utils (#19188)
Fixes ansible/ansible-modules-core#5840, moved from ansible/ansible-modules-core#5847
2016-12-11 09:00:01 +01:00
Fabio Alessandro Locati e788f13956 Remove unused quotes - files/unarchive.py (#19155) 2016-12-10 09:27:35 -05:00
Matt Clay c709b22e5c Fix differences with devel. 2016-12-08 11:35:21 -05:00
Fabio Alessandro Locati f5da520bbb Consistency in space between parenthesys (#18796) 2016-12-08 11:35:20 -05:00
James Cammarata 011ea55a8f Relocating extras into lib/ansible/modules/ after merge 2016-12-08 11:35:18 -05:00
James Cammarata 8afa090417 Resolving differences in core modules post-merge 2016-12-08 11:25:36 -05:00
Toshio Kuratomi 7319104552 Refreshed metadata for core modules 2016-12-08 11:25:35 -05:00
Fabio Alessandro Locati 2e34bad425 Call main in conditional way - files (#5828) 2016-12-08 11:25:35 -05:00
Fabio Alessandro Locati a5a15acd55 Native YAML - files/file.py (#5799)
* Native YAML - files/file.py

* Rollaback part of the change as for request
2016-12-08 11:25:35 -05:00
Brian Coca 2ba5967673 fix yaml format, clarify docs 2016-12-08 11:25:32 -05:00
Brian Coca b278fafec8 updated desc 2016-12-08 11:25:32 -05:00
Orion Poplawski ade7b47f28 Be able to find all contents of a directory (#3711) 2016-12-08 11:25:32 -05:00
jctanner 10f0d3ca95 Set b_src to abspath of b_path so that symlinks work again. (#5678)
Fixes #5653
2016-12-08 11:25:32 -05:00
David Wittman 85f6c26dff Add 'link' file_type to find_module
- Adds the 'link' file_type for finding symbolic or hard links
 - Use `os.lstat` instead of `os.stat` to prevent the following
   of links when statting the file.
2016-12-08 11:25:31 -05:00
Sam Doran 895179929c Examples syntax batch6 (#5623)
* Change example syntax on os_auth module

* Change example syntax on os_client_config module

* Change example syntax on os_image_facts module

* Change example syntax on os_networks_facts module

* Change example syntax on os_nova_flavor module

* Change example syntax on os_object module

* Change example syntax on os_server module

* Change example syntax on os_subnet_facts module

* Change example syntax on rax_files module

* Change example syntax on rax_files_objects module

* Change example syntax on mysql_db module

* Change example syntax on file module

* Change example syntax on uri module

* Change example syntax on cl_bond module

* Change example syntax on cl_bridge module

* Change example syntax on cl_img_install module

* Change example syntax on cl_interface module

* Change example syntax on cl_license module

* Change example syntax on cl_ports module

* Remove trailing colon
2016-12-08 11:25:31 -05:00
Sam Doran 385d34a3d7 Change example syntax on xattr module 2016-12-08 11:25:30 -05:00
Sam Doran c5921612d1 Change example syntax on unarchive module 2016-12-08 11:25:29 -05:00
Sam Doran f71134cb98 Change example syntax on template module 2016-12-08 11:25:29 -05:00
Sam Doran a1b945a23e > Change example syntax on synchronize module 2016-12-08 11:25:29 -05:00
Sam Doran 065749ee2a Change example syntax on stat module 2016-12-08 11:25:29 -05:00
Sam Doran d3e7d4f469 Change example syntax on replace module 2016-12-08 11:25:29 -05:00
Sam Doran 25f6f36a92 Change examples syntax on lineinfile module 2016-12-08 11:25:29 -05:00
Sam Doran 1923666b22 Change examples syntax on ini_file module 2016-12-08 11:25:29 -05:00
Sam Doran ba76df1af1 Change examples syntax on find module 2016-12-08 11:25:29 -05:00
Sam Doran 0c46813871 Change examples syntax on file module 2016-12-08 11:25:29 -05:00
Sam Doran 6ea87c583b Change examples syntax on fetch module 2016-12-08 11:25:29 -05:00
Sam Doran 532c77849a Change examples syntax on copy module 2016-12-08 11:25:29 -05:00
Sam Doran 8f097580ec Change examples syntax on assemble module 2016-12-08 11:25:28 -05:00
Sam Doran c694fe6ca4 Change examples syntax on acl module 2016-12-08 11:25:28 -05:00
Brian Coca 847cc0a1ec Revert "stat: doc: add version for new returns" 2016-12-08 11:25:28 -05:00
Brian Coca 50c9a276d7 added file flags/attributes to stat (#5358)
depends on http://github.com/ansible/ansible/issue/18213
also documented return version of fields added in 2.2
added get_mime to keep consistency
changed default mime behaviour
2016-12-08 11:25:28 -05:00
Gyorgy Szombathelyi 33ef72b584 Ini_file: fix regression with the create option
The new create option with the default value 'no' changes the
behavior from the previous Ansible releases. Change the default to
'yes' to create missing ini files by default.

Fixes: #5488
2016-12-08 11:25:28 -05:00
René Moser c8da9b012b stat: doc: add version for new returns (#5594) 2016-12-08 11:25:28 -05:00
Michael Herold e5cc4a45d3 Removes outdated "requirement" and outdated "note" (#5332)
- 7f59773460d79b3dae34c375ba68caea1bfc09a8 no longer uses `ConfigParser`
- 1d4c0abe2902d91b2895452feedcf72bf3dd9e20 removed the `import` statement
2016-12-08 11:25:26 -05:00
zuiurs eeecc3adcc fix the behavior that the dest is directory
This fixes the behavior that the dest is directory,
when we set the "force: no" argument.
To be join the dest and the src's basename,
before checking the "force" argument.
2016-12-08 11:25:25 -05:00
bencomp d25ba6a30a Make find return sample a YAML dict
In the description of the find module return value, the sample dict
has its key=value strings converted to key=value: None in the
web documentation. This commit updates the sample output to a 'real'
dict.

Minor additional edit in the description: "return list *of* files".
2016-12-08 11:25:24 -05:00