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

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/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. Since version 2.3, this module adds missing ending newlines to files to keep in line with the POSIX standard, even when no other modifications need to be applied.

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

#allow_no_valueSymbol?

Returns allow option without value and without ‘=’ symbol.

Returns:

  • (Symbol, nil)

    allow option without value and without ‘=’ symbol



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

attribute :allow_no_value

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



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

attribute :backup

#create:yes, ...

Returns If set to ‘no’, the module will fail if the file does not already exist. By default it will create the file if it is missing.

Returns:

  • (:yes, :no, nil)

    If set to ‘no’, the module will fail if the file does not already exist. By default it will create the file if it is missing.



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

attribute :create

#no_extra_spaces:yes, ...

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

Returns:

  • (:yes, :no, nil)

    Do not insert spaces before and after ‘=’ symbol



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

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



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

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



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

attribute :others

#pathString

Returns Path to the INI-style file; this file is created if required.,Before 2.3 this option was only usable as I(dest).

Returns:

  • (String)

    Path to the INI-style file; this file is created if required.,Before 2.3 this option was only usable as I(dest).



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

attribute :path

#sectionString

Returns Section name in INI file. This is added if C(state=present) automatically when a single value is being set.,If left empty or set to ‘null`, the I(option) will be placed before the first I(section). Using `null` is also required if the config format does not support sections.

Returns:

  • (String)

    Section name in INI file. This is added if C(state=present) automatically when a single value is being set.,If left empty or set to ‘null`, the I(option) will be placed before the first I(section). Using `null` is also required if the config format does not support sections.



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

attribute :section

#state:absent, ...

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

Returns:

  • (:absent, :present, nil)

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



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

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



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

attribute :value