Class: Ansible::Ruby::Modules::Ini_file
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Ini_file
- 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
-
#allow_no_value ⇒ Symbol?
Allow option without value and without ‘=’ symbol.
-
#backup ⇒ :yes, ...
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
-
#create ⇒ :yes, ...
If set to ‘no’, the module will fail if the file does not already exist.
-
#no_extra_spaces ⇒ :yes, ...
Do not insert spaces before and after ‘=’ symbol.
-
#option ⇒ String?
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).
-
#others ⇒ Object?
All arguments accepted by the M(file) module also work here.
-
#path ⇒ String
Path to the INI-style file; this file is created if required.,Before 2.3 this option was only usable as I(dest).
-
#section ⇒ String
Section name in INI file.
-
#state ⇒ :absent, ...
If set to C(absent) the option or section will be removed if present instead of created.
-
#value ⇒ String?
The string value to be associated with an I(option).
Methods inherited from Base
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_value ⇒ Symbol?
Returns 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.
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.
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.
41 |
# File 'lib/ansible/ruby/modules/generated/files/ini_file.rb', line 41 attribute :no_extra_spaces |
#option ⇒ String?
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).
22 |
# File 'lib/ansible/ruby/modules/generated/files/ini_file.rb', line 22 attribute :option |
#others ⇒ Object?
Returns 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 |
#path ⇒ String
Returns 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 |
#section ⇒ String
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.
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.
37 |
# File 'lib/ansible/ruby/modules/generated/files/ini_file.rb', line 37 attribute :state |
#value ⇒ String?
Returns 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 |