Skip to content

Instantly share code, notes, and snippets.

@jvanderaa
Created December 3, 2020 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvanderaa/5d890fc7906390e1dfdc01d297336965 to your computer and use it in GitHub Desktop.
Save jvanderaa/5d890fc7906390e1dfdc01d297336965 to your computer and use it in GitHub Desktop.
- name: "TASK 200: NETBOX >> Add temporary interface"
netbox.netbox.netbox_device_interface:
netbox_url: "{{ lookup('ENV', 'NETBOX_URL') }}"
netbox_token: "{{ lookup('ENV', 'NETBOX_API_KEY') }}"
data:
device: "{{ inventory_hostname }}"
name: Temporary_Interface
form_factor: Virtual
state: present
- name: "TASK 210: NETBOX >> ADD IP ADDRESS OF ANSIBLE HOST"
netbox.netbox.netbox_ip_address:
netbox_url: "{{ lookup('ENV', 'NETBOX_URL') }}"
netbox_token: "{{ lookup('ENV', 'NETBOX_API_KEY') }}"
data:
family: 4
address: "{{ ansible_host }}/24"
status: active
interface:
name: Temporary_Interface
device: "{{ inventory_hostname }}"
- name: "TASK 220: NETBOX >> ASSOCIATE IP ADDRESS TO DEVICE"
netbox.netbox.netbox_device:
netbox_url: "{{ lookup('ENV', 'NETBOX_URL') }}"
netbox_token: "{{ lookup('ENV', 'NETBOX_API_KEY') }}"
data:
name: "{{ inventory_hostname }}"
device_type: "{{ ansible_facts['net_model'] }}"
platform: IOS
serial: "{{ ansible_facts['net_serialnum'] }}"
status: Active
primary_ip4: "{{ ansible_host }}/24"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment