Skip to content

Instantly share code, notes, and snippets.

@ujwalkomarla
Last active March 28, 2019 15:25
Show Gist options
  • Save ujwalkomarla/a45223b6478875da5caf5a9d4eef4ec8 to your computer and use it in GitHub Desktop.
Save ujwalkomarla/a45223b6478875da5caf5a9d4eef4ec8 to your computer and use it in GitHub Desktop.
Ansible Restconf POST Method Issue
REST_SW1 ansible_host=10.68.5.65 ansible_network_os=restconf ansible_connection=httpapi ansible_user=admin ansible_ssh_pass= ansible_httpapi_restconf_root='/rest/restconf/data'
---
- name: Test POST
hosts: REST_SW1
gather_facts: false
tasks:
- name: Create VLAN
restconf_config:
path: openconfig-vlan:vlans
method: post
content: |
{
"openconfig-vlan:vlan": [
{
"config": {
"name": "ansible_1500",
"status": "ACTIVE",
"tpid": "oc-vlan-types:TPID_0x8100",
"vlan-id": 1500
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment