mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
HTTP(S) API connection plugin (#39224)
* HTTPAPI connection * Punt run_commands to cliconf or httpapi * Fake enable_mode on eapi * Pull changes to nxos * Move load_config to edit_config for future-preparedness * Don't fail on lldp disabled * Re-enable check_rc on nxos' run_commands * Reorganize nxos httpapi plugin for compatibility * draft docs for connection: httpapi * restores docs for connection:local for eapi * Add _remote_is_local to httpapi
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: collect any backup files
|
||||
@@ -29,7 +28,6 @@
|
||||
eos_config:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
lines:
|
||||
- ip address 119.31.1.1 255.255.255.256
|
||||
parents: interface Loopback911
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
check_mode: 1
|
||||
environment:
|
||||
@@ -25,7 +24,6 @@
|
||||
before:
|
||||
- "no ip access-list test"
|
||||
src: basic/cmds.j2
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
check_mode: yes
|
||||
register: config
|
||||
@@ -34,7 +32,6 @@
|
||||
eos_command:
|
||||
commands:
|
||||
- show configuration sessions | json
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -47,7 +44,6 @@
|
||||
lines:
|
||||
- ip address 119.31.1.1 255.255.255.256
|
||||
parents: interface Loopback911
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
check_mode: 1
|
||||
environment:
|
||||
@@ -64,7 +60,6 @@
|
||||
lines:
|
||||
- ip address 119.31.1.1 255.255.255.255
|
||||
parents: interface Loopback911
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
check_mode: yes
|
||||
register: result
|
||||
|
||||
@@ -5,13 +5,11 @@
|
||||
eos_config:
|
||||
lines: hostname {{ inventory_hostname_short }}
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: get current running-config
|
||||
eos_command:
|
||||
commands: show running-config
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: config
|
||||
|
||||
@@ -19,7 +17,6 @@
|
||||
eos_config:
|
||||
lines: hostname foo
|
||||
config: "{{ config.stdout[0] }}"
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -31,7 +28,6 @@
|
||||
- name: get current running-config
|
||||
eos_command:
|
||||
commands: show running-config
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: config
|
||||
|
||||
@@ -39,7 +35,6 @@
|
||||
eos_config:
|
||||
lines: hostname foo
|
||||
config: "{{ config.stdout[0] }}"
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -51,7 +46,6 @@
|
||||
eos_config:
|
||||
lines: hostname {{ inventory_hostname_short }}
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/config.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
@@ -9,14 +9,12 @@
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure device with defaults included
|
||||
eos_config:
|
||||
src: defaults/config.j2
|
||||
defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -31,7 +29,6 @@
|
||||
eos_config:
|
||||
src: defaults/config.j2
|
||||
defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
|
||||
@@ -9,14 +9,12 @@
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
|
||||
- name: save config always
|
||||
eos_config:
|
||||
save_when: always
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -27,7 +25,6 @@
|
||||
- name: save always again (not idempotent)
|
||||
eos_config:
|
||||
save_when: always
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
|
||||
@@ -9,13 +9,11 @@
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure device with config
|
||||
eos_config:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -29,7 +27,6 @@
|
||||
eos_config:
|
||||
src: basic/config.j2
|
||||
defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
- name: configure with invalid src
|
||||
eos_config:
|
||||
src: basic/foobar.j2
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
@@ -9,13 +9,11 @@
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure device with config
|
||||
eos_config:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
match: none
|
||||
become: yes
|
||||
register: result
|
||||
@@ -30,7 +28,6 @@
|
||||
eos_config:
|
||||
src: basic/config.j2
|
||||
defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
|
||||
@@ -5,14 +5,12 @@
|
||||
eos_config:
|
||||
lines: no vlan 10
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command
|
||||
eos_config:
|
||||
lines: name test
|
||||
parents: vlan 10
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -26,7 +24,6 @@
|
||||
eos_config:
|
||||
lines: name test
|
||||
parents: vlan 10
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -38,7 +35,6 @@
|
||||
eos_config:
|
||||
lines: no vlan 10
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
before: no ip access-list test
|
||||
after: exit
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command using block resplace
|
||||
@@ -24,7 +23,6 @@
|
||||
parents: ip access-list test
|
||||
replace: block
|
||||
after: exit
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -47,7 +45,6 @@
|
||||
parents: ip access-list test
|
||||
replace: block
|
||||
after: exit
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -59,7 +56,6 @@
|
||||
eos_config:
|
||||
lines: no ip access-list test
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
before: no ip access-list test
|
||||
after: exit
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command using exact match
|
||||
@@ -28,7 +27,6 @@
|
||||
after: exit
|
||||
match: exact
|
||||
replace: block
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -51,7 +49,6 @@
|
||||
- 40 permit ip host 4.4.4.4 any log
|
||||
parents: ip access-list test
|
||||
match: exact
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -63,7 +60,6 @@
|
||||
eos_config:
|
||||
lines: no ip access-list test
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
before: no ip access-list test
|
||||
after: exit
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command using strict match
|
||||
@@ -28,7 +27,6 @@
|
||||
after: exit
|
||||
match: strict
|
||||
replace: block
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -51,7 +49,6 @@
|
||||
- 40 permit ip host 4.4.4.4 any log
|
||||
parents: ip access-list test
|
||||
match: strict
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -63,7 +60,6 @@
|
||||
eos_config:
|
||||
lines: no ip access-list test
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
@@ -5,13 +5,11 @@
|
||||
eos_config:
|
||||
lines: hostname veos01
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure top level command
|
||||
eos_config:
|
||||
lines: hostname foo
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -23,7 +21,6 @@
|
||||
- name: configure top level command idempotent check
|
||||
eos_config:
|
||||
lines: hostname foo
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -35,7 +32,6 @@
|
||||
eos_config:
|
||||
lines: hostname veos01
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
@@ -7,14 +7,12 @@
|
||||
- snmp-server contact ansible
|
||||
- hostname veos01
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure top level command with before
|
||||
eos_config:
|
||||
lines: hostname foo
|
||||
after: snmp-server contact bar
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -28,7 +26,6 @@
|
||||
eos_config:
|
||||
lines: hostname foo
|
||||
after: snmp-server contact foo
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -42,7 +39,6 @@
|
||||
- no snmp-server contact
|
||||
- hostname veos01
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
@@ -7,14 +7,12 @@
|
||||
- snmp-server contact ansible
|
||||
- hostname veos01
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: configure top level command with before
|
||||
eos_config:
|
||||
lines: hostname foo
|
||||
before: snmp-server contact bar
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -28,7 +26,6 @@
|
||||
eos_config:
|
||||
lines: hostname foo
|
||||
before: snmp-server contact foo
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
@@ -42,7 +39,6 @@
|
||||
- hostname veos01
|
||||
- no snmp-server contact
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
Reference in New Issue
Block a user