Class: Ansible::Ruby::Modules::Replace
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Replace
- Defined in:
- lib/ansible/ruby/modules/generated/core/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
-
#backup ⇒ :yes, ...
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
-
#dest ⇒ String
The file to modify.
-
#follow ⇒ :yes, ...
This flag indicates that filesystem links, if they exist, should be followed.
-
#others ⇒ Object?
All arguments accepted by the M(file) module also work here.
-
#regexp ⇒ String
The regular expression to look for in the contents of the file.
-
#replace ⇒ String?
The string to replace regexp matches.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#backup ⇒ :yes, ...
Returns Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
24 |
# File 'lib/ansible/ruby/modules/generated/core/files/replace.rb', line 24 attribute :backup |
#dest ⇒ String
Returns The file to modify.
12 |
# File 'lib/ansible/ruby/modules/generated/core/files/replace.rb', line 12 attribute :dest |
#follow ⇒ :yes, ...
Returns This flag indicates that filesystem links, if they exist, should be followed.
31 |
# File 'lib/ansible/ruby/modules/generated/core/files/replace.rb', line 31 attribute :follow |
#others ⇒ Object?
Returns All arguments accepted by the M(file) module also work here.
28 |
# File 'lib/ansible/ruby/modules/generated/core/files/replace.rb', line 28 attribute :others |
#regexp ⇒ String
Returns The regular expression to look for in the contents of the file. Uses Python regular expressions; see U(docs.python.org/2/library/re.html). Uses multiline mode, which means C(^) and C($) match the beginning and end respectively of I(each line) of the file.
16 |
# File 'lib/ansible/ruby/modules/generated/core/files/replace.rb', line 16 attribute :regexp |
#replace ⇒ String?
Returns The string to replace regexp matches. May contain backreferences that will get expanded with the regexp capture groups if the regexp matches. If not set, matches are removed entirely.
20 |
# File 'lib/ansible/ruby/modules/generated/core/files/replace.rb', line 20 attribute :replace |