ansible-collections / ansible.network

Ansible Network Collection for network and IP utilities that are not specific to any platform or OS.
GNU General Public License v3.0
18 stars 18 forks source link

Proposal: Ansible Network Validated Content Base Application #32

Closed rohitthakur2590 closed 1 year ago

rohitthakur2590 commented 2 years ago

Proposal:

network.base application acts as core for other validated content, as it provides the platform agnostic role called Resource Manager.This role provides a single platform-agnostics entry point to manage all the resources supported for a given network OS. Author: Rohit Thakur (@rohitthakur2590)

Date: 2022/06/21

Motivation

Describe the reasons for this proposal. Provide Network Base Vaidated Content to act as core for other validated content to acheive platform agnostic resource management.

Problems

Solution proposal

list.yaml:

---
- hosts: ios
  tasks:
  - name: invoke list function
    include_role:
      name: resource_manager
    vars:
      ansible_network_os: cisco.ios.ios
      action: list

gather.yaml:

---
- hosts: ios
  gather_facts: false
  tasks:
  - name: invoke gather function
    include_role:
      name: resource_manager
    vars:
      action: gather
      ansible_network_os: cisco.ios.ios
      resources:
        - 'interfaces'
        - 'l2_interfaces'
        - 'l3_interfaces'

persist.yaml:

---
- hosts: ios
  tasks:
  - name: invoke persist function
    include_role:
      name: resource_manager
    vars:
      action: persist
      ansible_network_os: cisco.ios.ios
      resources:
        - 'interfaces'
        - 'l2_interfaces'
        - 'l3_interfaces'

deploy.yaml:

---
- hosts: ios
  tasks:
  - name: invoke persist function
    include_role:
      name: resource_manager
    vars:
      action: deploy
      ansible_network_os: cisco.ios.ios
      resources:
        - 'all'

config.yaml:

---
- hosts: ios
  tasks:
  - name: invoke persist function
    include_role:
      name: resource_manager
    vars:
      action: configure
      ansible_network_os: cisco.ios.ios
      config:
        - name: "GigabitEthernet0/0"
          description: "Edited with Configure operation"
      state: merged

Testing (optional)

Documentation (optional)