Skip to content

Commit

Permalink
adding ipaddress readme
Browse files Browse the repository at this point in the history
  • Loading branch information
IPvSean committed Sep 26, 2017
1 parent 8f69966 commit accbc3d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
# ansible-napalm-samples
GitHub Repo comparing NAPALM and Ansible on Cisco NXOSv
# Ansible and NAPALM Samples
This GitHub Repo focuses on comparing Ansible NAPALM on Cisco NXOS.

# Example 1 - Adding an IP address to an interface

## Ansible

Ansible has a [nxos_config](http://docs.ansible.com/ansible/latest/nxos_config_module.html) specifically used for making config changes (either entire flat-files) or partials (in this case editing a single interface)
```
- hosts: cisco
connection: local
tasks:
- nxos_config:
lines:
- no switchport
- ip address 172.16.1.1/24
parents: interface Ethernet1/20
provider: "{{login_info}}"
```

To run a playbook use the `ansible-playbook` command:

```
[root@localhost ~]# ansible-playbook ipaddress.yml
PLAY [cisco] *****************************************************************************************************************************************************************************************
TASK [nxos_config] ***********************************************************************************************************************************************************************************
ok: [n9k]
PLAY RECAP *******************************************************************************************************************************************************************************************
n9k : ok=1 changed=0 unreachable=0 failed=0
```

# Example 2 - Backing up a Config
3 changes: 3 additions & 0 deletions group_vars/all
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
login_info:
username: admin
password: Bullf00d
1 change: 0 additions & 1 deletion ipaddress.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- hosts: cisco
gather_facts: False
connection: local
tasks:
- nxos_config:
Expand Down

0 comments on commit accbc3d

Please sign in to comment.