1234567891011121314151617181920212223242526272829303132333435363738394041 |
- ---
- - name: Apply interface configuration for- "{{ inventory_hostname }}"
- uri:
- url: http://{{ inventory_hostname }}/admin/launch?script=json
- method: POST
- body_format: json
- headers:
- Cookie: "{{ login.set_cookie.split(';')[0] }}"
- body:
- {
- "commands":
- [
- "interface {{ item.key }}",
- "description {{ item.value.description | default('<none>') }}",
- "{{ item.value.config | default([]) |join(', ') }}"
- ]
- }
- register: interface_conf
- - name: Status check for- "{{ inventory_hostname }}"
- fail:
- msg: "{{ results }}"
- when: results.status != "OK"
- loop: "{{ interface_conf.json.results }}"
- loop_control:
- loop_var: results
- label: "{{ results.executed_command }}"
|