{"id":18337411,"url":"https://github.com/nmake/nxos_native_yang","last_synced_at":"2026-05-02T02:38:32.020Z","repository":{"id":74047154,"uuid":"220821237","full_name":"nmake/nxos_native_yang","owner":"nmake","description":"An Ansible role to mange the configuration of nx-os devices","archived":false,"fork":false,"pushed_at":"2019-11-10T17:15:12.000Z","size":200,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T20:17:20.476Z","etag":null,"topics":["ansible","cisco","cisco-nx-os","netconf","nexus","role","yang"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-10T17:01:55.000Z","updated_at":"2020-03-03T06:34:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7b165d9-ccce-4268-a7bb-e75966e85cc4","html_url":"https://github.com/nmake/nxos_native_yang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmake%2Fnxos_native_yang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmake%2Fnxos_native_yang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmake%2Fnxos_native_yang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmake%2Fnxos_native_yang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmake","download_url":"https://codeload.github.com/nmake/nxos_native_yang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103859,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","cisco","cisco-nx-os","netconf","nexus","role","yang"],"created_at":"2024-11-05T20:11:07.304Z","updated_at":"2026-05-02T02:38:31.983Z","avatar_url":"https://github.com/nmake.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NXOS native yang\n\nThis is an Ansible role used to push and pull the configuration from nexus devices using netconf and the nx-os native yang model.\n\nNo working knowledge of netconf or yang is necessary.\n\n## Prerequisits\n\n- netconf enabled on the device\n- ncclient installed\n- Ansible 2.10 or later\n\nThe role provide a number actions shown below:\n\n## Show the supported resources available for a given device\n\n```yaml\n\n- name: Show all the available resources for this device\n  include_role:\n    name: nxos_native_yang\n  vars:\n    action: get_available_resources\n\nTASK [nxos_native_yang : Show the available resources] ************************\nok: [nxos101] =\u003e\n  nxos_native_yang['available_resources']:\n  - acct-items\n  - acl-items\n  - acllog-items\n  - action-items\n  - actrl-items\n  - actrlcapprov-items\n  - adjacency-items\n  - analytics-items\n  - arp-items\n  - bd-items\n  \u003c...\u003e\n```\n\n## Show a sample data structure for a given resource\n\n```yaml\n- name: Show the sample data structure for a resource\n  include_role:\n    name: nxos_native_yang\n  vars:\n    action: get_samples\n    resources:\n    - vtp-items\n\nTASK [nxos_native_yang : Show the samples] ************************************\nok: [nxos101] =\u003e\n  samples:\n    vtp-items:\n      inst-items:\n        ctrl: null\n        domain: null\n        name: null\n        operErr: null\n        password: null\n      name: null\n      operErr: null\n```\n\n## Gather facts for specific resources\n\n```yaml\n- name: Gather facts for specifc resources\n  include_role:\n    name: nxos_native_yang\n  vars:\n    action: gather_facts\n    resources:\n    - bd-items\n    - intf-items\n\n  TASK [debug] ****************************************************************\n  ok: [nxos101] =\u003e\n    native_yang_facts:\n      bd-items:\n        bd-items:\n          BD-list:\n          - BdState: active\n            adminSt: active\n            bridgeMode: mac\n            fabEncap: vlan-42\n            fwdCtrl: mdst-flood\n            fwdMode: bridge,route\n            id: '42'\n            mode: CE\n            name: ffffff\n            xConnect: disable\n            \u003c...\u003e\n      intf-items:\n        phys-items:\n          PhysIf-list:\n          - FECMode: auto\n            accessVlan: vlan-1\n            adminSt: up\n            autoNeg: 'on'\n            beacon: 'off'\n            bw: '0'\n            controllerId: null\n            delay: '1'\n            dot1qEtherType: '0x8100'\n            duplex: auto\n            eeep-items:\n              eeeLat: variable\n              eeeLpi: aggressive\n              eeeState: not-applicable\n            id: eth1/71\n            \u003c...\u003e\n```\n\n## Build an inventory for all resources available\n\n```yaml\n\n- name: Generate an inventory file entry for the given resources\n  include_role:\n    name: nxos_native_yang\n  vars:\n    action: generate_inventory\n    inventory_path: \"./inventory/host_vars/{{ inventory_hostname }}\"\n    resources:\n    - all\n    - '!acl-items'\n\n\n$ tree inventory\ninventory\n|-- host_vars\n|   `-- nxos101\n|       |-- acct-items.yaml\n|       |-- acllog-items.yaml\n|       |-- action-items.yaml\n|       |-- actrlcapprov-items.yaml\n|       |-- actrl-items.yaml\n|       |-- adjacency-items.yaml\n|       |-- analytics-items.yaml\n|       |-- arp-items.yaml\n|       |-- bd-items.yaml\n|       |-- bdTable-items.yaml\n|       |-- bfd-items.yaml\n|       |-- bgp-items.yaml\n|       |-- boot-items.yaml\n\n```\n\n## Apply configuration to the device\n\n```yaml\n\n- name: Apply configuration to the device\n  include_role:\n    name: nxos_native_yang\n  vars:\n    action: apply_configuration\n    check_mode: True\n    resources:\n    - name: \"bd-items\"\n      config: \"{{ hostvars[inventory_hostname]['bd-items'] }}\"\n    - name: \"intf-items\"\n      config: \"{{ hostvars[inventory_hostname]['intf-items'] }}\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmake%2Fnxos_native_yang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmake%2Fnxos_native_yang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmake%2Fnxos_native_yang/lists"}