项目作者: dbono711

项目描述 :
Ansible role for Cisco Network Services Orchestrator (NSO) Local installation
高级语言: Jinja
项目地址: git://github.com/dbono711/ansible-nso-local-install.git
创建时间: 2021-05-20T13:08:44Z
项目社区:https://github.com/dbono711/ansible-nso-local-install

开源协议:MIT License

下载


Ansible Role: NSO Local Installation

Ansible role for Cisco Network Services Orchestrator (NSO) Local installation

Overview

  • Execute NSO Local installation
    • Include external YANG files
  • Create NSO runtime environment
    • Customize the runtime configuration
    • Automatically build and load NED’s
    • Create, customize, and load NSO NETSIM’s
    • Configure NSO CDB

Restrictions

  • The use of this role assumes the user can obtain the appropriate binaries as noted in Prerequisites
    • Evaluation copies for NSO & various NSO NED’s can be found on DevNet

Prerequisites

  • Ansible
    • Ansible >= 2.9.1 (might work with earlier versions, but not tested)
  • NSO
    • Python >= 3.9.6
    • Operating System requirements as described on DevNet (Java + Ant)
      • NOTE: If Java or Ant binaries are installed in a location other than the default per the Operating System requirements on DevNet, you can change the respective java_binary or ant_binary variables in the appropriate Operating System vars file
      • NOTE: Assumes the target host has build-essentials (gcc, make, etc.) and xsltproc installed
    • NSO Signed Binary (*.signed.bin)
      • A single NSO signed binary must be placed within the (files) folder
    • NED Signed Binaries (*.signed.bin)
      • The NED signed binaries must be placed within the (files) folder

Latest NSO Version

  • 6.2

Role Variables

All variables which can be overridden are stored in various files within defaults/main

Setup (setup.yml)

These variables are directly related to running the NSO Local installation and NSO Runtime environment

Name Default Description
nso_root_dir “~/nso” Root path to directory where the NSO installation, runtime, external YANG files, and NETSIM will reside.

In other words, nso_install_dir, nso_runtime_dir, nso_yang_dir, and nso_netsim_dir are all derived from this variable within vars/main.yml.
nso_yang_files [] External YANG files (i.e.; those not included as part of NSO installation) to be installed. Examples provided in the file.

NETSIM (netsim-vars.yml)

These variables are directly related to the creation of NETSIM devices

Name Default Description
nso_netsim [] List of NETSIM devices to be created. Allows specifying the number of NETSIM devices per type, number of GigabitEthernet, and number of TenGigabitEthernet interfaces.

Runtime Configuration (nso-runtime-config.yml)

These variables are directly related to the parameters used to construct the NSO runtime configuration, ncs.conf, abstracted from the various ‘Configuration Parameters’ found in the NSO Manual Pages.

Name Default Description
nso_config_hide_group [] Corresponds to the /ncs-config/hide-group section.
nso_config_rollback {} Corresponds to the /ncs-config/rollback section.
nso_config_cli {} Corresponds to the /ncs-config/cli section.
nso_config_webui_tcp {} Corresponds to the /ncs-config/webui/transport/tcp section.
nso_config_webui_ssl {} Corresponds to the /ncs-config/webui/transport/ssl section.
nso_config_restconf {} Corresponds to the /ncs-config/restconf section.

Sample Playbook

  1. ---
  2. - name: NSO Local Installation
  3. hosts: all
  4. gather_facts: yes
  5. vars:
  6. nso_root_dir: "~/nso"
  7. nso_yang_files:
  8. - name: "ietf-routing-types.yang"
  9. uri: "https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-routing-types%402017-12-04.yang"
  10. nso_netsim:
  11. - type: iosxr
  12. type_count: 3
  13. type_count_gige: 2
  14. type_count_tengige: 2
  15. nso_config_hide_group:
  16. - name: debug
  17. nso_config_rollback:
  18. enabled: true
  19. directory: ./logs
  20. history_size: 500
  21. nso_config_cli:
  22. rollback_numbering: rolling
  23. nso_config_webui_ssl:
  24. enabled: true
  25. ip: 0.0.0.0
  26. port: 8888
  27. key_file: ${NCS_DIR}/var/ncs/webui/cert/host.key
  28. cert_file: ${NCS_DIR}/var/ncs/webui/cert/host.cert
  29. tasks:
  30. - name: Setup NSO
  31. include_role:
  32. name: dbono711.ansible_nso_local_install
  33. tags:
  34. - "always"

Local Testing

Testing is accomplished with Molecule. After installing Molecule in your local environment, you can execute the complete test suite via:

molecule test

Additional Resources

Learning NSO

Documentation Guides

Authors

License

This project is licensed under the MIT License. See LICENSE for details