Class: Ansible::Ruby::Modules::Eos_config

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/network/eos/eos_config.rb

Overview

Arista EOS configurations use a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with EOS configuration sections in a deterministic way. This module works with either CLI or eAPI transports.

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

#afterObject?

Returns The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with I(before) this allows the playbook designer to append a set of commands to be executed after the command set.

Returns:

  • (Object, nil)

    The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with I(before) this allows the playbook designer to append a set of commands to be executed after the command set.



28
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 28

attribute :after

#backup:yes, ...

Returns This argument will cause the module to create a full backup of the current C(running-config) from the remote device before any changes are made. The backup file is written to the C(backup) folder in the playbook root directory or role root directory, if playbook is part of an ansible role. If the directory does not exist, it is created.

Returns:

  • (:yes, :no, nil)

    This argument will cause the module to create a full backup of the current C(running-config) from the remote device before any changes are made. The backup file is written to the C(backup) folder in the playbook root directory or role root directory, if playbook is part of an ansible role. If the directory does not exist, it is created.



43
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 43

attribute :backup

#beforeString?

Returns The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system.

Returns:

  • (String, nil)

    The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system.



24
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 24

attribute :before

#defaults:yes, ...

Returns The I(defaults) argument will influence how the running-config is collected from the device. When the value is set to true, the command used to collect the running-config is append with the all keyword. When the value is set to false, the command is issued without the all keyword.

Returns:

  • (:yes, :no, nil)

    The I(defaults) argument will influence how the running-config is collected from the device. When the value is set to true, the command used to collect the running-config is append with the all keyword. When the value is set to false, the command is issued without the all keyword



50
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 50

attribute :defaults

#diff_against:startup, ...

Returns When using the C(ansible-playbook –diff) command line argument the module can generate diffs against different sources.,When this option is configure as I(startup), the module will return the diff of the running-config against the startup-config.,When this option is configured as I(intended), the module will return the diff of the running-config against the configuration provided in the C(intended_config) argument.,When this option is configured as I(running), the module will return the before and after diff of the running-config with respect to any changes made to the device configuration.,When this option is configured as C(session), the diff returned will be based on the configuration session.

Returns:

  • (:startup, :running, :intended, :session, nil)

    When using the C(ansible-playbook –diff) command line argument the module can generate diffs against different sources.,When this option is configure as I(startup), the module will return the diff of the running-config against the startup-config.,When this option is configured as I(intended), the module will return the diff of the running-config against the configuration provided in the C(intended_config) argument.,When this option is configured as I(running), the module will return the before and after diff of the running-config with respect to any changes made to the device configuration.,When this option is configured as C(session), the diff returned will be based on the configuration session.



62
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 62

attribute :diff_against

#diff_ignore_linesObject?

Returns Use this argument to specify one or more lines that should be ignored during the diff. This is used for lines in the configuration that are automatically updated by the system. This argument takes a list of regular expressions or exact line matches.

Returns:

  • (Object, nil)

    Use this argument to specify one or more lines that should be ignored during the diff. This is used for lines in the configuration that are automatically updated by the system. This argument takes a list of regular expressions or exact line matches.



66
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 66

attribute :diff_ignore_lines

#force:yes, ...

Returns The force argument instructs the module to not consider the current devices running-config. When set to true, this will cause the module to push the contents of I(src) into the device without first checking if already configured.,Note this argument should be considered deprecated. To achieve the equivalent, set the C(match=none) which is idempotent. This argument will be removed in Ansible 2.6.

Returns:

  • (:yes, :no, nil)

    The force argument instructs the module to not consider the current devices running-config. When set to true, this will cause the module to push the contents of I(src) into the device without first checking if already configured.,Note this argument should be considered deprecated. To achieve the equivalent, set the C(match=none) which is idempotent. This argument will be removed in Ansible 2.6.



39
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 39

attribute :force

#intended_configString?

Returns The C(intended_config) provides the master configuration that the node should conform to and is used to check the final running-config against. This argument will not modify any settings on the remote device and is strictly used to check the compliance of the current device’s configuration against. When specifying this argument, the task should also modify the C(diff_against) value and set it to I(intended).

Returns:

  • (String, nil)

    The C(intended_config) provides the master configuration that the node should conform to and is used to check the final running-config against. This argument will not modify any settings on the remote device and is strictly used to check the compliance of the current device’s configuration against. When specifying this argument, the task should also modify the C(diff_against) value and set it to I(intended).



69
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 69

attribute :intended_config

#linesArray<String>, ...

Returns The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.

Returns:

  • (Array<String>, String, nil)

    The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.



12
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 12

attribute :lines

#match:line, ...

Returns Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to I(line), commands are matched line by line. If match is set to I(strict), command lines are matched with respect to position. If match is set to I(exact), command lines must be an equal match. Finally, if match is set to I(none), the module will not attempt to compare the source configuration with the running configuration on the remote device.

Returns:

  • (:line, :strict, :exact, :none, nil)

    Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to I(line), commands are matched line by line. If match is set to I(strict), command lines are matched with respect to position. If match is set to I(exact), command lines must be an equal match. Finally, if match is set to I(none), the module will not attempt to compare the source configuration with the running configuration on the remote device.



31
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 31

attribute :match

#parentsString?

Returns The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands.

Returns:

  • (String, nil)

    The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands.



16
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 16

attribute :parents

#replace:line, ...

Returns Instructs the module on the way to perform the configuration on the device. If the replace argument is set to I(line) then the modified lines are pushed to the device in configuration mode. If the replace argument is set to I(block) then the entire command block is pushed to the device in configuration mode if any line is not correct.

Returns:

  • (:line, :block, :config, nil)

    Instructs the module on the way to perform the configuration on the device. If the replace argument is set to I(line) then the modified lines are pushed to the device in configuration mode. If the replace argument is set to I(block) then the entire command block is pushed to the device in configuration mode if any line is not correct.



35
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 35

attribute :replace

#running_configObject?

Returns The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The I(running_config) argument allows the implementer to pass in the configuration to use as the base config for this module.

Returns:

  • (Object, nil)

    The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The I(running_config) argument allows the implementer to pass in the configuration to use as the base config for this module.



47
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 47

attribute :running_config

#save:yes, ...

Returns The C(save) argument instructs the module to save the running-config to startup-config. This operation is performed after any changes are made to the current running config. If no changes are made, the configuration is still saved to the startup config. This option will always cause the module to return changed.,This option is deprecated as of Ansible 2.4 and will be removed in Ansible 2.8, use C(save_when) instead.

Returns:

  • (:yes, :no, nil)

    The C(save) argument instructs the module to save the running-config to startup-config. This operation is performed after any changes are made to the current running config. If no changes are made, the configuration is still saved to the startup config. This option will always cause the module to return changed.,This option is deprecated as of Ansible 2.4 and will be removed in Ansible 2.8, use C(save_when) instead.



54
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 54

attribute :save

#save_when:always, ...

Returns When changes are made to the device running-configuration, the changes are not copied to non-volatile storage by default. Using this argument will change that before. If the argument is set to I(always), then the running-config will always be copied to the startup-config and the I(modified) flag will always be set to True. If the argument is set to I(modified), then the running-config will only be copied to the startup-config if it has changed since the last save to startup-config. If the argument is set to I(never), the running-config will never be copied to the startup-config. If the argument is set to I(changed), then the running-config will only be copied to the startup-config if the task has made a change. I(changed) was added in Ansible 2.5.

Returns:

  • (:always, :never, :modified, :changed, nil)

    When changes are made to the device running-configuration, the changes are not copied to non-volatile storage by default. Using this argument will change that before. If the argument is set to I(always), then the running-config will always be copied to the startup-config and the I(modified) flag will always be set to True. If the argument is set to I(modified), then the running-config will only be copied to the startup-config if it has changed since the last save to startup-config. If the argument is set to I(never), the running-config will never be copied to the startup-config. If the argument is set to I(changed), then the running-config will only be copied to the startup-config if the task has made a change. I(changed) was added in Ansible 2.5.



58
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 58

attribute :save_when

#srcString?

Returns The I(src) argument provides a path to the configuration file to load into the remote system. The path can either be a full system path to the configuration file if the value starts with / or relative to the root of the implemented role or playbook. This argument is mutually exclusive with the I(lines) and I(parents) arguments. It can be a Jinja2 template as well. src file must have same indentation as a live switch config. Arista EOS device config has 3 spaces indentation.

Returns:

  • (String, nil)

    The I(src) argument provides a path to the configuration file to load into the remote system. The path can either be a full system path to the configuration file if the value starts with / or relative to the root of the implemented role or playbook. This argument is mutually exclusive with the I(lines) and I(parents) arguments. It can be a Jinja2 template as well. src file must have same indentation as a live switch config. Arista EOS device config has 3 spaces indentation.



20
# File 'lib/ansible/ruby/modules/generated/network/eos/eos_config.rb', line 20

attribute :src