-
Couldn't load subscription status.
- Fork 167
"compare" mode is added. #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
substituted with "commit_mode" |
|
@ymitsos Can you explain the benefit of this pull request vs. simply running the module in check mode? With your pull request, it appears "commit_mode: 'check'" would be exactly equivalent to running the module in check mode. In addition, it appears the only functional difference between "commit_mode: 'check'" and "commit_mode: 'compare'" would be that the latter does not perform the "commit check". In all cases the configuration diff file is produced. I simply don't see any benefit from this pull request. Especially with Ansible >= 2.2 where individual tasks can be run in check mode. |
|
indeed, with commit_mode set to check you gain the same behaviour as with switch -C; however, when you have a complex network or many playbooks that need to be orchestrated and combined together to produce a result, you may prefer to control the running mode inside the playbook to avoid unpleasant surprises if you omit the "-C" in command line in one run. Secondly, there are cases where you need to run a big job with some tasks that are not harmful (e.g. fetch data from other sources like databases, WHOIS server and produce local YAML files for further processing) and those tasks should not be run in check mode, while other task should that interact with network equipment should be run in check mode. Furthermore, "compare" is different to "check". In the former you only get the diffs while in the latter you perform a commit-check that is a task requiring CPU resources and elevated access privileges. Concluding, this patch comes mainly from our need to run complex playbooks that produce the entire configuration of all network gear (routers, switches, data center switches). The playbooks run in defined intervals and we need to have good flexibility of the changes submitted to production boxes. |
Indeed, that is the capability supported by Ansible in 2.2 for all tasks: I understand the desire to skip the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good. If you can update to address the conflicts, I will merge ASAP.
check_commit option controlls whether a "commit check" or "show | compare" command will be executed. The latter requires less privileges and is preferred when one needs to check changes against a running configuration instance. Refers to Juniper#163
Using the latter, one can compare the generated configuration changes against the running configuration. Changes are not staged to the equipment. Similar to "show | compare" in Juniper edit mode.