Skip to content

Instantly share code, notes, and snippets.

@afaqk9394
Created March 5, 2020 01:00
Show Gist options
  • Save afaqk9394/57ceb5d30074f68b450a84076178ef09 to your computer and use it in GitHub Desktop.
Save afaqk9394/57ceb5d30074f68b450a84076178ef09 to your computer and use it in GitHub Desktop.
---
- hosts: router_fsn
gather_facts: no
connection: local
tasks:
- name: Login
include_vars: secrets.yml
- name: Provider definition
set_fact:
provider:
host: "{{ ansible_host }}"
username: "{{ creds['username'] }}"
password: "{{ creds['password'] }}"
auth_pass: "{{ creds['auth_pass'] }}"
- name: IP address assignment
ios_config:
provider: "{{ provider }}"
authorize: yes
parents: "interface giga0/1"
lines:
- description FullStackNetworker
- ip address 10.10.0.1 255.255.255.248
- ipv6 address 2001:db8:2009::9/64
- no shutdown
- name: save IOS configuration and backup
ios_config:
provider: "{{ provider }}"
authorize: yes
save: yes
backup: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment