Class: Ansible::Ruby::Modules::Ini_file

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

Overview

Manage (add, remove, change) individual settings in an INI-style file without having to manage the file as a whole with, say, M(template) or M(assemble). Adds missing sections if they don’t exist. Before version 2.0, comments are discarded when the source file is read, and therefore will not show up in the destination file.

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.



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

attribute :backup

#destString

Returns Path to the INI-style file; this file is created if required.

Returns:

  • (String)

    Path to the INI-style file; this file is created if required



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

attribute :dest

#no_extra_spacesBoolean?

Returns do not insert spaces before and after ‘=’ symbol.

Returns:

  • (Boolean, nil)

    do not insert spaces before and after ‘=’ symbol



39
# File 'lib/ansible/ruby/modules/generated/core/files/ini_file.rb', line 39

attribute :no_extra_spaces

#optionString?

Returns if set (required for changing a I(value)), this is the name of the option.,May be omitted if adding/removing a whole I(section).

Returns:

  • (String, nil)

    if set (required for changing a I(value)), this is the name of the option.,May be omitted if adding/removing a whole I(section).



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

attribute :option

#othersObject?

Returns all arguments accepted by the M(file) module also work here.

Returns:

  • (Object, nil)

    all arguments accepted by the M(file) module also work here



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

attribute :others

#sectionString

Returns Section name in INI file. This is added if C(state=present) automatically when a single value is being set.

Returns:

  • (String)

    Section name in INI file. This is added if C(state=present) automatically when a single value is being set.



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

attribute :section

#state:present, ...

Returns If set to C(absent) the option or section will be removed if present instead of created.

Returns:

  • (:present, :absent, nil)

    If set to C(absent) the option or section will be removed if present instead of created.



35
# File 'lib/ansible/ruby/modules/generated/core/files/ini_file.rb', line 35

attribute :state

#valueString?

Returns the string value to be associated with an I(option). May be omitted when removing an I(option).

Returns:

  • (String, nil)

    the string value to be associated with an I(option). May be omitted when removing an I(option).



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

attribute :value