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

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/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, fix_inclusion, #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.



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

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).



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

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.



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

attribute :create

#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 expression 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 expression has no matches, C(EOF) will be used instead.



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

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 expression 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 expression has no matches, the block will be inserted at the end of the file.



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

attribute :insertbefore

#markerString?

Returns The marker line template. “mark” will be replaced with the values in marker_begin (default=“BEGIN”) and marker_end (default=“END”).

Returns:

  • (String, nil)

    The marker line template. “mark” will be replaced with the values in marker_begin (default=“BEGIN”) and marker_end (default=“END”).



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

attribute :marker

#marker_beginString?

Returns This will be inserted at mark in the opening ansible block marker.

Returns:

  • (String, nil)

    This will be inserted at mark in the opening ansible block marker.



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

attribute :marker_begin

#marker_endString?

Returns This will be inserted at mark in the closing ansible block marker.

Returns:

  • (String, nil)

    This will be inserted at mark in the closing ansible block marker.



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

attribute :marker_end

#pathString

Returns The file to modify.,Before 2.3 this option was only usable as I(dest), I(destfile) and I(name).

Returns:

  • (String)

    The file to modify.,Before 2.3 this option was only usable as I(dest), I(destfile) and I(name).



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

attribute :path

#state:absent, ...

Returns Whether the block should be there or not.

Returns:

  • (:absent, :present, nil)

    Whether the block should be there or not.



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

attribute :state