Class: Ansible::Ruby::Modules::Blockinfile

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb

Overview

This module will insert/update/remove a block of multi-line text surrounded by customizable marker lines.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

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.

Returns:

  • (:yes, :no, nil)

    Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.



39
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 39

attribute :backup

#blockString?

Returns The text to insert inside the marker lines. If it’s missing or an empty string, the block will be removed as if C(state) were specified to C(absent).

Returns:

  • (String, nil)

    The text to insert inside the marker lines. If it’s missing or an empty string, the block will be removed as if C(state) were specified to C(absent).



23
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 23

attribute :block

#create:yes, ...

Returns Create a new file if it doesn’t exist.

Returns:

  • (:yes, :no, nil)

    Create a new file if it doesn’t exist.



35
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 35

attribute :create

#destString

Returns The file to modify.

Returns:

  • (String)

    The file to modify.



11
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 11

attribute :dest

#follow:yes, ...

Returns This flag indicates that filesystem links, if they exist, should be followed.

Returns:

  • (:yes, :no, nil)

    This flag indicates that filesystem links, if they exist, should be followed.



43
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 43

attribute :follow

#insertafter:EOF, ...

Returns If specified, the block will be inserted after the last match of specified regular expression. A special value is available; C(EOF) for inserting the block at the end of the file. If specified regular expresion has no matches, C(EOF) will be used instead.

Returns:

  • (:EOF, :"*regex*", nil)

    If specified, the block will be inserted after the last match of specified regular expression. A special value is available; C(EOF) for inserting the block at the end of the file. If specified regular expresion has no matches, C(EOF) will be used instead.



27
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 27

attribute :insertafter

#insertbefore:BOF, ...

Returns If specified, the block will be inserted before the last match of specified regular expression. A special value is available; C(BOF) for inserting the block at the beginning of the file. If specified regular expresion has no matches, the block will be inserted at the end of the file.

Returns:

  • (:BOF, :"*regex*", nil)

    If specified, the block will be inserted before the last match of specified regular expression. A special value is available; C(BOF) for inserting the block at the beginning of the file. If specified regular expresion has no matches, the block will be inserted at the end of the file.



31
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 31

attribute :insertbefore

#markerString?

Returns The marker line template. “mark” will be replaced with “BEGIN” or “END”.

Returns:

  • (String, nil)

    The marker line template. “mark” will be replaced with “BEGIN” or “END”.



19
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 19

attribute :marker

#state:present, ...

Returns Whether the block should be there or not.

Returns:

  • (:present, :absent, nil)

    Whether the block should be there or not.



15
# File 'lib/ansible/ruby/modules/generated/extras/files/blockinfile.rb', line 15

attribute :state