{ "info": { "author": "Jason Edelman", "author_email": "jedelman8@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "\n# Multi-vendor Ansible Modules for Network Automation\n\nYou need to perform **two** steps to start using these modules.\n\n1. Ensure this repository is in your Ansible module search path\n2. Install Dependencies \n\n\n## Ensure Modules are you in your search path\n\nFirst, understand what your search path is:\n\n```\nntc@ntc:~/projects$ ansible --version\nansible 2.1.1.0\n config file = /etc/ansible/ansible.cfg\n configured module search path = ???\n```\n\nIf you already have a search path configured, clone the repo (see options below) while you are in your search path.\n\nIf you have a \"default\" or No search path shown, open the config file that is shown in the output above, here that is `/etc/ansible/ansible.cfg`. In that file, you'll see these first few lines:\n\n```\n[defaults]\n\n# some basic default values...\n\ninventory = /etc/ansible/hosts\nlibrary = /home/ntc/projects/\n```\n\nAdd a path for `library` - this will become your search path. Validate it with `ansible --version` after you make the change.\n\nWhen you clone, do not forget to use `--recursive `!\n\n**Option 1:**\n\n```\ngit clone https://github.com/networktocode/ntc-ansible --recursive\n```\n\n**Option 2:**\n\n```\ngit clone https://github.com/networktocode/ntc-ansible\ncd ntc-ansible\ngit submodule update --init --recursive\n```\n\nNote: if you want to use **ntc_show_command** for parsing with ntc-templates, you navigate to that directory after the clone and run the setup.py file, e.g. `sudo python setup.py install`.\n\n\nAs a quick test and sanity use `ansible-doc` on one of the modules before trying to use them in a playbook. For example, try this:\n\n```\n$ ansible-doc ntc_file_copy\n```\n\nIf that works, Ansible can find the modules and you can proceed to installing the deps below.\n\n\n## Install Dependencies\n\n**Option 1:**\n\n```\npip install ntc-ansible\n```\n\n**Option 2:**\n\n_If you already cloned it above, you can just run the third statement below._\n\n```\ngit clone https://github.com/networktocode/ntc-ansible\ncd ntc-ansible\nsudo python setup.py install\n```\n\n\nAdditionally, you'll need `lxml` can install like this on Ubuntu:\n\n```\nsudo apt-get install zlib1g-dev libxml2-dev libxslt-dev python-dev\n```\n\nEvery so often `terminal` is not installed and it may need to be installed manually:\n\n```\npip install terminal\n```\n\n\n## Modules\n\n * **ntc_show_command** - gets structured data from devices that don't have an API. This module uses SSH to connect to devices. Supports as many device types as netmiko supports.\n * **ntc_config_command** - sends commands to devices that don't have an API. This module uses SSH to connect to devices. Supports as many device types as netmiko supports.\n * **ntc_save_config** - saves the running config and optionally copies it to the Ansible control host for an offline backup. Uses SSH/netmiko for IOS, NX-API for Nexus, and eAPI for Arista.\n * **ntc_file_copy** - copies a file from the Ansible control host to a network device. Uses SSH for IOS, NX-API for Nexus, and eAPI for Arista.\n * **ntc_reboot** - reboots a network device. Uses SSH/netmiko for IOS, NX-API for Nexus, and eAPI for Arista.\n * **ntc_get_facts** - gathers facts from a network device. Uses SSH/netmiko for IOS, NX-API for Nexus, and eAPI for Arista.\n * **ntc_rollback** - performs two major functions. (1) Creates a checkpoint file or backup running config on box. (2) Rolls back to the previously created checkpoint/backup config. Use case is to create the checkpoint/backup as the first task in a playbook and then rollback to it _if_ needed using block/rescue, i.e. try/except in Ansible. Uses SSH/netmiko for IOS, NX-API for Nexus, and eAPI for Arista.\n * **ntc_install_os** - installs a new operating system or just sets boot options. Depends on platform. Does not issue a \"reload\" command, but the device may perform an automatic reboot. Common workflow is to use ntc_file_copy, ntc_install_os, and then ntc_reboot (if needed) for upgrades. Uses SSH/netmiko for IOS, NX-API for Nexus, and eAPI for Arista.\n\n## Common Issues\n\n#### Gather Facts\n\nStarting in Ansible 2.1 there is a name space conflict when gathering facts. The below message will indicate the issues:\n\n```\nTASK [Gathering Facts] *************************************************************************\n*Using module file /home/bdowling/src/ansible-modules/ntc-ansible/setup.cfg*\nfatal: [rtr02]: FAILED! => {\n \"failed\": true, \n \"msg\": \"module (setup) is missing interpreter line\"\n}\n\nmsg: module (setup) is missing interpreter line\n\nPLAY RECAP *************************************************************************************\nrtr02 : ok=0 changed=0 unreachable=0 failed=1 \n```\n\nYou can solve this by either changing the `gather_facts` to no, or removing the 3 `setup.XX` files.\n\nGather Facts Example: \n```\n- hosts: test\n connection: local\n gather_facts: no\n```\n\nRemove Files Example:\n```\nrm ./setup.cfg\nrm ./setup.py\nrm ./ntc-templates/setup.py\n```\nSee https://github.com/ansible/ansible/issues/20702 and https://github.com/ansible/ansible/pull/20717 for further details.\n\n#### This module requires TextFSM\n\nMost often seen in virtual enviroments as per ansible's interpretation of which python binary you are using is not as expected. You can tell that you have reached this issue if you correctly have textfsm installed, but receive the following warning:\n\n```\nFAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"This module requires TextFSM\"}\n```\nTo fix this add the following to your inventory or similar to your `group_vars/all.yml`\n\n```\n[vars:all]\nansible_python_interpreter=\"/usr/bin/env python\"\n```\nsee https://github.com/ansible/ansible/issues/6345#issuecomment-181999529 for further details. \n\n## Examples\n\nSee [Examples](examples.md)\n\n## Background\n\n**ntc_show_command** and **ntc_config_command** were the first two modules written out of this group. These two use netmiko for transport - this means if netmiko supports a given platform, these modules can be used.\n\nAll other modules support Nexus using pyntc, Arista using pyeapi, IOS using netmiko, and Juniper using PyEZ.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/networktocode/ntc-ansible/tarball/0.1.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/networktocode/ntc-ansible", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ntc-ansible", "package_url": "https://pypi.org/project/ntc-ansible/", "platform": "", "project_url": "https://pypi.org/project/ntc-ansible/", "project_urls": { "Download": "https://github.com/networktocode/ntc-ansible/tarball/0.1.0", "Homepage": "https://github.com/networktocode/ntc-ansible" }, "release_url": "https://pypi.org/project/ntc-ansible/0.9.2/", "requires_dist": [ "pynxos", "pyntc", "netmiko" ], "requires_python": "", "summary": "Dependencies for NTC Ansible modules", "version": "0.9.2", "yanked": false, "yanked_reason": null }, "last_serial": 6013377, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9f539b255cb9b335030ae43dc411a081", "sha256": "f4927903ed416bc4e5f92545d1e33700790187ebebb64c1dfc7b183af820b09a" }, "downloads": -1, "filename": "ntc_ansible-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9f539b255cb9b335030ae43dc411a081", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1726, "upload_time": "2019-10-21T15:45:38", "upload_time_iso_8601": "2019-10-21T15:45:38.085250Z", "url": "https://files.pythonhosted.org/packages/38/53/0b50c2898e352855b434cfedd9727c78d1d1e2a3a7660a5eec8d1516b9be/ntc_ansible-0.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "5cdab748bf5e41cbacee2f012d25b5da", "sha256": "6617e4a54260d812d36cdd66768d40c2a1b7d88f34e125465253271094158a63" }, "downloads": -1, "filename": "ntc-ansible-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5cdab748bf5e41cbacee2f012d25b5da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2572, "upload_time": "2016-01-19T17:10:44", "upload_time_iso_8601": "2016-01-19T17:10:44.554852Z", "url": "https://files.pythonhosted.org/packages/9f/9f/01dc56080aff7acdd0d14b2642dacec0fce967826950094b172824dca3b2/ntc-ansible-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "3b812476de2447c8fca24d71f2eb9590", "sha256": "10ea574ff27f0b699dcb7a35877e366d2832f1849aa149e65d92cd3882d5e282" }, "downloads": -1, "filename": "ntc_ansible-0.9.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3b812476de2447c8fca24d71f2eb9590", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4084, "upload_time": "2019-10-21T15:45:40", "upload_time_iso_8601": "2019-10-21T15:45:40.137102Z", "url": "https://files.pythonhosted.org/packages/55/8a/1e5277c5b133f45271747cf7b2cdf8706261d5b7ce0ffc75f3e46a64f08d/ntc_ansible-0.9.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "daec945257d50c8bac67223ff05986aa", "sha256": "81ddce32a0cdebeb09e2f54844733c62a46bfb5d7e74fa14cc4369d038cd0905" }, "downloads": -1, "filename": "ntc-ansible-0.9.1.tar.gz", "has_sig": false, "md5_digest": "daec945257d50c8bac67223ff05986aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3919, "upload_time": "2019-10-21T15:45:41", "upload_time_iso_8601": "2019-10-21T15:45:41.634778Z", "url": "https://files.pythonhosted.org/packages/bf/a3/62c21dadd1a4063ccfe292b65e6174788d4eaeb7f5afc63632f3eb22bce0/ntc-ansible-0.9.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "662bf8b9a407f521cd6ca0e95a71ad3a", "sha256": "8b57ce906267eb64a6994a40bf465e27089de3b81aaf2422fcc6c8840eae35f4" }, "downloads": -1, "filename": "ntc_ansible-0.9.2-py3-none-any.whl", "has_sig": false, "md5_digest": "662bf8b9a407f521cd6ca0e95a71ad3a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4084, "upload_time": "2019-10-22T15:07:03", "upload_time_iso_8601": "2019-10-22T15:07:03.763405Z", "url": "https://files.pythonhosted.org/packages/bd/34/343dd76d35c2f7217671bac2661c078563917de4483a9b3c29558d250076/ntc_ansible-0.9.2-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "a95966d7c6baa9cf861b85ba6f89143f", "sha256": "b28e3063a9cccbb1817101f9fa97aa981df65511944830fe3f9797467f060afb" }, "downloads": -1, "filename": "ntc-ansible-0.9.2.tar.gz", "has_sig": false, "md5_digest": "a95966d7c6baa9cf861b85ba6f89143f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3950, "upload_time": "2019-10-22T15:07:04", "upload_time_iso_8601": "2019-10-22T15:07:04.777038Z", "url": "https://files.pythonhosted.org/packages/7b/c2/2f12847984ca7447349e32d744e7c38de997ebdc34a941d725757aad1467/ntc-ansible-0.9.2.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "662bf8b9a407f521cd6ca0e95a71ad3a", "sha256": "8b57ce906267eb64a6994a40bf465e27089de3b81aaf2422fcc6c8840eae35f4" }, "downloads": -1, "filename": "ntc_ansible-0.9.2-py3-none-any.whl", "has_sig": false, "md5_digest": "662bf8b9a407f521cd6ca0e95a71ad3a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4084, "upload_time": "2019-10-22T15:07:03", "upload_time_iso_8601": "2019-10-22T15:07:03.763405Z", "url": "https://files.pythonhosted.org/packages/bd/34/343dd76d35c2f7217671bac2661c078563917de4483a9b3c29558d250076/ntc_ansible-0.9.2-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "a95966d7c6baa9cf861b85ba6f89143f", "sha256": "b28e3063a9cccbb1817101f9fa97aa981df65511944830fe3f9797467f060afb" }, "downloads": -1, "filename": "ntc-ansible-0.9.2.tar.gz", "has_sig": false, "md5_digest": "a95966d7c6baa9cf861b85ba6f89143f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3950, "upload_time": "2019-10-22T15:07:04", "upload_time_iso_8601": "2019-10-22T15:07:04.777038Z", "url": "https://files.pythonhosted.org/packages/7b/c2/2f12847984ca7447349e32d744e7c38de997ebdc34a941d725757aad1467/ntc-ansible-0.9.2.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }