summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/files/lineinfile.py
Commit message (Collapse)AuthorAgeFilesLines
* make lineinfile docs clearer and make module pep8 (#23857)Sloane Hertel2017-04-231-3/+4
|
* New metadata 1.0 (#22587)Toshio Kuratomi2017-03-141-3/+4
| | | | | | | | | | | | | | | | Changes to the metadata format were approved here: https://github.com/ansible/proposals/issues/54 * Update documentation to the new metadata format * Changes to metadata-tool to account for new metadata * Add GPL license header * Add upgrade subcommand to upgrade metadata version * Change default metadata to the new format * Fix exclusion of non-modules from the metadata report * Fix ansible-doc for new module metadata * Exclude metadata version from ansible-doc output * Fix website docs generation for the new metadata * Update metadata schema in valiate-modules test * Update the metadata in all modules to the new version
* PEP 8 indent cleanup. (#20800)Matt Clay2017-01-291-1/+1
| | | | | | | | * PEP 8 E121 cleanup. * PEP 8 E126 cleanup. * PEP 8 E122 cleanup.
* Correct typos. (#20490)HyungCheol Kim2017-01-201-1/+1
|
* Consistent path attribute for file-related modulesDag Wieers2017-01-131-20/+24
| | | | | | | | 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.
* Fix code-blocks to use correct syntax highlightingToshio Kuratomi2017-01-081-3/+4
|
* Fix differences with devel.Matt Clay2016-12-081-1/+1
|
* Resolving differences in core modules post-mergeJames Cammarata2016-12-081-2/+3
|
* Refreshed metadata for core modulesToshio Kuratomi2016-12-081-0/+4
|
* Change examples syntax on lineinfile moduleSam Doran2016-12-081-14/+49
|
* to_text, to_bytes, and to_native now have surrogate_or_strict error handler ↵Toshio Kuratomi2016-12-081-12/+14
| | | | | | | | | (#4630) On python3, we want to use the surrogateescape error handler if available for filesystem paths and the like. On python2, have to use strict in these circumstances. Use the new error strategy for to_text, to_bytes, and to_native that allows this.
* Fixes for lineinfile (#4553)Toshio Kuratomi2016-12-081-63/+71
| | | | | | Lineinfile deals heavily with Unic text files. Makes some sense to deal with it all as byte strings. So there is a lot of work done here to show that we're dealing with byte strings throughout.
* unsafe writes! (#4314)Brian Coca2016-12-081-1/+1
| | | | | | | | * unsafe writes! * moved unsafe_write docs and args to file common * added unsafe_writes option handling
* The documentation of lineinfile now makes reference to blockinfile (#3639)Marcos Diez2016-12-081-4/+4
|
* Fixed module doc typosJose Moreira2016-12-081-2/+2
|
* Add diff for both file contents and file attributes to lineinfileTobias Wolf2016-12-081-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the difflist feature added in ansible/ansible@c337293 we can add two diffs to the `diff` dict returned as JSON: A `before` and `after` pair of changed file contents and the diff of the file attributes. n.b.: the difflist handling from the above commit is logically broken. PR will follow. Example output: TASK [change line and mode] ************************************************************ changed: [localhost] --- before: /tmp/sshd_config (content) +++ after: /tmp/sshd_config (content) @@ -65,21 +65,21 @@ X11DisplayOffset 10 PrintMotd no PrintLastLog yes TCPKeepAlive yes #UseLogin no #MaxStartups 10:30:60 #Banner /etc/issue.net # Allow client to pass locale environment variables -AcceptEnv LANG LC_* +AcceptEnv LANG LC_* GF_ENV_* Subsystem sftp /usr/lib/openssh/sftp-server # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without --- before: /tmp/sshd_config (file attributes) +++ after: /tmp/sshd_config (file attributes) @@ -1,3 +1,3 @@ { - "mode": "0700" + "mode": "0644" }
* Move validate command into doc fragment and fix a few typosJeff Widman2016-12-081-10/+1
|
* Do not insert extra newline if line already contains itgimoh2016-12-081-2/+5
| | | | | | | | | | | | When using YAML multi-line strings, e.g.: - lineinfile: dest: /tmp/foo line: > foo bar the line already ends with a newline. If an extra newline is appended unconditionally it will lead to inserting an extra newline on each run.
* Proper author info for all remaining modulesGreg DeKoenigsberg2016-12-081-1/+3
|
* use the right way to unescape line string Reference ↵jaypei2016-12-081-17/+0
| | | | https://github.com/ansible/ansible/issues/10864
* Fix use of codecs.escape_decode()Toshio Kuratomi2016-12-081-1/+1
|
* Slightly more future-proof version of the lineinfile fixToshio Kuratomi2016-12-081-8/+5
|
* Correct lineinfile documentation about double quoting... Hasn't been the ↵Toshio Kuratomi2016-12-081-2/+1
| | | | case for years.
* Clarify the documented behaviour of insertbefore slightly.Toshio Kuratomi2016-12-081-2/+2
|
* update docs for insertbefore/insertafterPiotr Gosławski2016-12-081-5/+7
|
* Fix behavior when insert* doesn't match anythingPiotr Gosławski2016-12-081-5/+2
| | | | If insertbefore/insertafter didn't match anything, lineinfile module was doing nothing, instead of adding the line at end of fille as it's supposed to.
* Fix breakage in lineinfile check mode when target file does not exist.Jeff Bradberry2016-12-081-1/+4
| | | | | | | | Similarly to https://github.com/ansible/ansible/issues/6182, checking of the file attributes should be avoided in check mode when the file didn't originally exist. Also, avoid creating parent directories in check mode. Fixes https://github.com/ansible/ansible/issues/9546
* Fix lineinfile documentation typoEric2016-12-081-1/+1
|
* Adding file doc fragment to those modules in files/ missing itJames Cammarata2016-12-081-0/+1
|
* Tweak docs to mention `replace`Eric Hanchrow2016-12-081-2/+4
|
* Updating SELinux example doc in lininefile moduleMajor Hayden2016-12-081-1/+1
| | | | | | | Encouraging users to use this Ansible module to enable SELinux seems like a better idea. It also warms Dan Walsh's heart. Signed-off-by: Major Hayden <major@mhtx.net>
* file extensions!Michael DeHaan2016-12-081-0/+400