Skip to content
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

Implement Commit Confirm Support For Resource Modules #440

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rohitthakur2590
Copy link
Collaborator

@rohitthakur2590 rohitthakur2590 commented Aug 16, 2023

SUMMARY

resolve: #384

The current implementation of junos resource modules commits changes right away i.e playbook executes multiple junos resource modules in a row and we don't have the option to revert changes at the end of the playbook if we are left with undesired configuration.

In some cases this could also add to large CPU consumption, Junos_config does have confirm option and implementing this feature option in resource modules would give ability to

  • ability to revert changes if the playbook executes multiple Junos modules in a row and results are undesired.
  • leverage upon confirm commit feature supported by junos.
  • it can also help to reduce large CPU utilization.
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

- name:  Try config and commit if everything is as planned
  hosts: junos
  collections:
    - junipernetworks.junos
  vars:
    ansible_junos_commit_confirmed: true
    ansible_junos_commit_confirmed_timeout: 5
  tasks:
  - name: Merge provided config into running-config
     junos_interfaces:
         config: "{{ l3_interfaces }}"

  - name: Merge provided config into running-config
     junos_interfaces:
         config: "{{ ospfv2}}"

   - name: Merge provided config into running-config
      junos_interfaces:
         config: "{{ ospf_interfaces }}"
        
   - name: Confirm Last Commits
      junos_config:
         confirm_commit: yes

@rohitthakur2590 rohitthakur2590 added the feature This issue/PR relates to a feature request. label Aug 16, 2023
@rohitthakur2590 rohitthakur2590 changed the title Implement Commit Confirm Support In Resource Modules [WIP] Implement Commit Confirm Support In Resource Modules Aug 16, 2023
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/01362e9301454c929d6b15001085bf37

ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 8m 29s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 FAILURE in 1h 20m 44s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 FAILURE in 1h 07m 36s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 FAILURE in 13m 46s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 8m 54s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 SUCCESS in 16m 17s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 SUCCESS in 16m 48s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 FAILURE in 12m 56s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 RETRY_LIMIT in 9m 14s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 SUCCESS in 16m 58s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 FAILURE in 17m 02s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 NODE_FAILURE Node request 200-0006291195 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable215 NODE_FAILURE Node request 200-0006291196 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable215 NODE_FAILURE Node request 200-0006291197 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable215 NODE_FAILURE Node request 200-0006291198 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable214 NODE_FAILURE Node request 200-0006291199 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable214 NODE_FAILURE Node request 200-0006291200 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable214 NODE_FAILURE Node request 200-0006291201 failed in 0s (non-voting)
✔️ build-ansible-collection SUCCESS in 9m 10s
✔️ ansible-tox-linters SUCCESS in 11m 38s
✔️ ansible-galaxy-importer SUCCESS in 5m 14s

plugins/modules/junos_interfaces.py Outdated Show resolved Hide resolved
@rohitthakur2590 rohitthakur2590 changed the title [WIP] Implement Commit Confirm Support In Resource Modules [WIP] Implement Commit Support In Resource Modules Aug 16, 2023
@rohitthakur2590 rohitthakur2590 temporarily deployed to ack October 30, 2023 11:47 — with GitHub Actions Inactive
@pre-commit-ci pre-commit-ci bot temporarily deployed to ack October 30, 2023 11:48 Inactive
Signed-off-by: rohitthakur2590 <[email protected]>
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a12ab2e) 82.34% compared to head (aabad06) 82.34%.
Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #440   +/-   ##
=======================================
  Coverage   82.34%   82.34%           
=======================================
  Files         139      139           
  Lines       13137    13137           
=======================================
  Hits        10818    10818           
  Misses       2319     2319           

Signed-off-by: rohitthakur2590 <[email protected]>
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/70b435efade942ef8c2a7de26ce2fb09

ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 6m 01s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 SUCCESS in 1h 14m 45s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 SUCCESS in 1h 03m 07s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 FAILURE in 12m 27s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 5m 59s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 RETRY_LIMIT in 5m 58s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 FAILURE in 16m 28s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 FAILURE in 13m 05s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 RETRY_LIMIT in 5m 49s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 FAILURE in 12m 39s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 FAILURE in 15m 47s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 FAILURE in 16m 26s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-netconf-python39-stable215 SUCCESS in 1h 05m 36s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable215 FAILURE in 15m 31s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable215 FAILURE in 15m 36s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-netconf-python39-stable214 SUCCESS in 1h 05m 25s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable214 FAILURE in 15m 40s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable214 FAILURE in 16m 10s (non-voting)
✔️ build-ansible-collection SUCCESS in 9m 51s
✔️ ansible-tox-linters SUCCESS in 12m 02s
✔️ ansible-galaxy-importer SUCCESS in 4m 44s

Signed-off-by: rohitthakur2590 <[email protected]>
Signed-off-by: rohitthakur2590 <[email protected]>
Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/3a00fe925d7e4f0d9e0fb512ff4d5e9d

ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 6m 45s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 FAILURE in 1h 14m 54s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 RETRY_LIMIT in 7m 12s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 FAILURE in 13m 30s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 6m 59s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 FAILURE in 15m 01s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 FAILURE in 16m 54s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 FAILURE in 12m 41s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 RETRY_LIMIT in 12m 25s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 FAILURE in 14m 40s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 FAILURE in 16m 08s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 FAILURE in 15m 05s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable215 FAILURE in 1h 05m 53s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable215 FAILURE in 16m 01s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable215 FAILURE in 15m 15s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable214 FAILURE in 1h 04m 32s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable214 FAILURE in 15m 49s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable214 FAILURE in 14m 45s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 09s
ansible-tox-linters FAILURE in 12m 09s
✔️ ansible-galaxy-importer SUCCESS in 7m 24s

Signed-off-by: rohitthakur2590 <[email protected]>
Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/2c8a491a45d64987a65d2239c46e5d4c

ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 8m 54s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 FAILURE in 1h 20m 49s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 FAILURE in 1h 09m 42s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 FAILURE in 13m 17s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 10m 32s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 NODE_FAILURE Node request 200-0006865351 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 NODE_FAILURE Node request 200-0006865352 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 NODE_FAILURE Node request 200-0006865353 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 NODE_FAILURE Node request 200-0006865354 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 NODE_FAILURE Node request 200-0006865355 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 NODE_FAILURE Node request 200-0006865356 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 NODE_FAILURE Node request 200-0006865357 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable215 NODE_FAILURE Node request 200-0006865358 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable215 NODE_FAILURE Node request 200-0006865359 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable215 FAILURE in 15m 14s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python39-stable214 NODE_FAILURE Node request 200-0006865361 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python39-stable214 FAILURE in 16m 00s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable214 FAILURE in 14m 20s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 03s
ansible-tox-linters FAILURE in 11m 58s
✔️ ansible-galaxy-importer SUCCESS in 5m 04s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature This issue/PR relates to a feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support confirm option ito control commit/timer in Resource Modules
2 participants