Class: Ansible::Ruby::Modules::Replace
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Replace
- Includes:
- Helpers::FileAttributes
- Defined in:
- lib/ansible/ruby/modules/generated/files/replace.rb,
lib/ansible/ruby/modules/custom/files/replace.rb
Overview
This module will replace all instances of a pattern within a file. It is up to the user to maintain idempotence by ensuring that the same pattern would never match any replacements made.
Instance Method Summary collapse
-
#after ⇒ String?
If specified, the line after the replace/remove will start.
-
#backup ⇒ :yes, ...
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
-
#before ⇒ String?
If specified, the line before the replace/remove will occur.
-
#encoding ⇒ String?
The character encoding for reading and writing the file.
-
#others ⇒ Object?
All arguments accepted by the M(file) module also work here.
-
#path ⇒ String
The file to modify.,Before 2.3 this option was only usable as I(dest), I(destfile) and I(name).
-
#regexp ⇒ String
The regular expression to look for in the contents of the file.
-
#replace ⇒ String?
The string to replace regexp matches.
Methods included from Helpers::FileAttributes
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#after ⇒ String?
25 |
# File 'lib/ansible/ruby/modules/generated/files/replace.rb', line 25 attribute :after |
#backup ⇒ :yes, ...
33 |
# File 'lib/ansible/ruby/modules/generated/files/replace.rb', line 33 attribute :backup |
#before ⇒ String?
29 |
# File 'lib/ansible/ruby/modules/generated/files/replace.rb', line 29 attribute :before |
#encoding ⇒ String?
40 |
# File 'lib/ansible/ruby/modules/generated/files/replace.rb', line 40 attribute :encoding |
#others ⇒ Object?
37 |
# File 'lib/ansible/ruby/modules/generated/files/replace.rb', line 37 attribute :others |
#path ⇒ String
13 |
# File 'lib/ansible/ruby/modules/generated/files/replace.rb', line 13 attribute :path |
#regexp ⇒ String
17 |
# File 'lib/ansible/ruby/modules/generated/files/replace.rb', line 17 attribute :regexp |
#replace ⇒ String?
21 |
# File 'lib/ansible/ruby/modules/generated/files/replace.rb', line 21 attribute :replace |