Class: Ansible::Ruby::Modules::Cnos_conditional_template
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Cnos_conditional_template
- Defined in:
- lib/ansible/ruby/modules/generated/network/cnos/cnos_conditional_template.rb
Overview
This module allows you to work with the running configuration of a switch. It provides a way to execute a set of CNOS commands on a switch by evaluating the current running configuration and executing the commands only if the specific settings have not been already configured. The configuration source can be a set of commands or a template written in the Jinja2 templating language. This module functions the same as the cnos_template module. The only exception is that the following inventory variable can be specified. ["condition =
Instance Method Summary collapse
-
#commandfile ⇒ Object
This specifies the path to the CNOS command file which needs to be applied.
-
#condition ⇒ Object
If you specify condition=
in the inventory file against any device, the template execution is done for that device in case it matches the flag setting for that task. -
#flag ⇒ Object
If a task needs to be executed, you have to set the flag the same as it is specified in the inventory for that device.
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
#commandfile ⇒ Object
Returns This specifies the path to the CNOS command file which needs to be applied. This usually comes from the commands folder. Generally this file is the output of the variables applied on a template file. So this command is preceded by a template module. The command file must contain the Ansible keyword inventory_hostname } and the condition flag in its filename to ensure that the command file is unique for each switch and condition. If this is omitted, the command file will be overwritten during iteration. For example, commandfile=./commands/clos_leaf_bgp_ inventory_hostname }_LP21_commands.txt.
12 |
# File 'lib/ansible/ruby/modules/generated/network/cnos/cnos_conditional_template.rb', line 12 attribute :commandfile |
#condition ⇒ Object
Returns If you specify condition=
16 |
# File 'lib/ansible/ruby/modules/generated/network/cnos/cnos_conditional_template.rb', line 16 attribute :condition |
#flag ⇒ Object
Returns If a task needs to be executed, you have to set the flag the same as it is specified in the inventory for that device.
20 |
# File 'lib/ansible/ruby/modules/generated/network/cnos/cnos_conditional_template.rb', line 20 attribute :flag |