Use inventory_hostname_short (#20054)

When using AWS we have to use the full domain name in the inventory file, which
we rather than the short name. This change avoids that ending up being
set in the tests.
This commit is contained in:
John R Barker 2017-01-09 17:21:04 +00:00 committed by GitHub
parent a2b4ad9da0
commit fb3bef7f46
62 changed files with 123 additions and 123 deletions

View file

@ -11,7 +11,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -36,7 +36,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -29,7 +29,7 @@
- name: teardown - name: teardown
asa_config: asa_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
- debug: msg="END cli/toplevel.yaml" - debug: msg="END cli/toplevel.yaml"

View file

@ -36,7 +36,7 @@
asa_config: asa_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
- debug: msg="END cli/toplevel_after.yaml" - debug: msg="END cli/toplevel_after.yaml"

View file

@ -36,7 +36,7 @@
asa_config: asa_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
- debug: msg="END cli/toplevel_before.yaml" - debug: msg="END cli/toplevel_before.yaml"

View file

@ -32,7 +32,7 @@
- name: teardown - name: teardown
asa_config: asa_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
- debug: msg="END cli/toplevel_nonidempotent.yaml" - debug: msg="END cli/toplevel_nonidempotent.yaml"

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
dellos10_config: dellos10_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -30,7 +30,7 @@
- name: teardown - name: teardown
dellos10_config: dellos10_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
dellos10_config: dellos10_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
dellos10_config: dellos10_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
dellos10_config: dellos10_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
dellos10_config: dellos10_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
dellos10_config: dellos10_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -32,7 +32,7 @@
- name: teardown - name: teardown
dellos10_config: dellos10_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
dellos6_config: dellos6_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -30,7 +30,7 @@
- name: teardown - name: teardown
dellos6_config: dellos6_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
dellos6_config: dellos6_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
dellos6_config: dellos6_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
dellos6_config: dellos6_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
dellos6_config: dellos6_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
dellos6_config: dellos6_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -32,7 +32,7 @@
- name: teardown - name: teardown
dellos6_config: dellos6_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
dellos9_config: dellos9_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -30,7 +30,7 @@
- name: teardown - name: teardown
dellos9_config: dellos9_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
dellos9_config: dellos9_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
dellos9_config: dellos9_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
dellos9_config: dellos9_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
dellos9_config: dellos9_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
dellos9_config: dellos9_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -32,7 +32,7 @@
- name: teardown - name: teardown
dellos9_config: dellos9_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
eos_config: eos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
match: none match: none
provider: "{{ cli }}" provider: "{{ cli }}"
@ -39,7 +39,7 @@
- name: teardown - name: teardown
eos_config: eos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
match: none match: none
provider: "{{ cli }}" provider: "{{ cli }}"

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
eos_config: eos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
match: none match: none
provider: "{{ eapi }}" provider: "{{ eapi }}"
@ -30,7 +30,7 @@
- name: teardown - name: teardown
eos_config: eos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
match: none match: none
provider: "{{ eapi }}" provider: "{{ eapi }}"

View file

@ -5,7 +5,7 @@
eos_config: eos_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
match: none match: none
provider: "{{ eapi }}" provider: "{{ eapi }}"
@ -37,7 +37,7 @@
eos_config: eos_config:
lines: lines:
- no snmp-server contact - no snmp-server contact
- hostname {{ inventory_hostname }} - hostname {{ inventory_hostname_short }}
match: none match: none
provider: "{{ eapi }}" provider: "{{ eapi }}"

View file

@ -5,7 +5,7 @@
eos_config: eos_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
match: none match: none
provider: "{{ eapi }}" provider: "{{ eapi }}"
@ -37,7 +37,7 @@
eos_config: eos_config:
lines: lines:
- no snmp-server contact ansible - no snmp-server contact ansible
- hostname {{ inventory_hostname }} - hostname {{ inventory_hostname_short }}
match: none match: none
provider: "{{ eapi }}" provider: "{{ eapi }}"

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
ios_config: ios_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -30,7 +30,7 @@
- name: teardown - name: teardown
ios_config: ios_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
ios_config: ios_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
ios_config: ios_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
ios_config: ios_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
ios_config: ios_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
ios_config: ios_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -32,7 +32,7 @@
- name: teardown - name: teardown
ios_config: ios_config:
lines: ['hostname {{ inventory_hostname }}'] lines: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -12,7 +12,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -37,7 +37,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
iosxr_config: iosxr_config:
commands: ['hostname {{ inventory_hostname }}'] commands: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -30,7 +30,7 @@
- name: teardown - name: teardown
iosxr_config: iosxr_config:
commands: ['hostname {{ inventory_hostname }}'] commands: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
iosxr_config: iosxr_config:
commands: commands:
- "no cdp" - "no cdp"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
iosxr_config: iosxr_config:
commands: commands:
- "no cdp" - "no cdp"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
iosxr_config: iosxr_config:
commands: commands:
- "no cdp" - "no cdp"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
iosxr_config: iosxr_config:
commands: commands:
- "no cdp" - "no cdp"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
iosxr_config: iosxr_config:
commands: ['hostname {{ inventory_hostname }}'] commands: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -32,7 +32,7 @@
- name: teardown - name: teardown
iosxr_config: iosxr_config:
commands: ['hostname {{ inventory_hostname }}'] commands: ['hostname {{ inventory_hostname_short }}']
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -1,4 +1,4 @@
hostname {{ inventory_hostname }} hostname {{ inventory_hostname_short }}
! !
interface Loopback999 interface Loopback999
description this is a test description this is a test

View file

@ -12,7 +12,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -37,7 +37,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -4,14 +4,14 @@
- name: setup - name: setup
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
- delete interfaces lo0 - delete interfaces lo0
provider: "{{ netconf }}" provider: "{{ netconf }}"
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -36,7 +36,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -16,7 +16,7 @@
- name: configure multiple invalid command - name: configure multiple invalid command
junos_config: junos_config:
lines: lines:
- 'set system host-name {{ inventory_hostname }}' - 'set system host-name {{ inventory_hostname_short }}'
- 'set system foo' - 'set system foo'
provider: "{{ netconf }}" provider: "{{ netconf }}"
register: result register: result

View file

@ -4,7 +4,7 @@
- name: setup - name: setup
junos_config: junos_config:
lines: lines:
- "set system host-name {{ inventory_hostname }}" - "set system host-name {{ inventory_hostname_short }}"
- "delete interfaces lo0" - "delete interfaces lo0"
provider: "{{ netconf }}" provider: "{{ netconf }}"
register: test register: test
@ -12,7 +12,7 @@
- name: configure multiple commands - name: configure multiple commands
junos_config: junos_config:
lines: lines:
- 'set system host-name {{ inventory_hostname }}' - 'set system host-name {{ inventory_hostname_short }}'
- 'set interfaces lo0 unit 0 family inet address 1.1.1.1/32' - 'set interfaces lo0 unit 0 family inet address 1.1.1.1/32'
provider: "{{ netconf }}" provider: "{{ netconf }}"
register: result register: result
@ -28,7 +28,7 @@
- name: check multiple commands idempotent - name: check multiple commands idempotent
junos_config: junos_config:
lines: lines:
- 'set system host-name {{ inventory_hostname }}' - 'set system host-name {{ inventory_hostname_short }}'
- 'set interfaces lo0 unit 0 family inet address 1.1.1.1/32' - 'set interfaces lo0 unit 0 family inet address 1.1.1.1/32'
provider: "{{ netconf }}" provider: "{{ netconf }}"
register: result register: result
@ -41,7 +41,7 @@
- name: teardown - name: teardown
junos_config: junos_config:
lines: lines:
- "set system host-name {{ inventory_hostname }}" - "set system host-name {{ inventory_hostname_short }}"
- "delete interfaces lo0" - "delete interfaces lo0"
provider: "{{ netconf }}" provider: "{{ netconf }}"
register: test register: test

View file

@ -5,7 +5,7 @@
- name: setup - name: setup
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
provider: "{{ netconf }}" provider: "{{ netconf }}"
- name: configure single command - name: configure single command
@ -34,7 +34,7 @@
- name: teardown - name: teardown
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
provider: "{{ netconf }}" provider: "{{ netconf }}"

View file

@ -4,7 +4,7 @@
- name: setup - name: setup
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
- delete interfaces lo0 - delete interfaces lo0
provider: "{{ netconf }}" provider: "{{ netconf }}"

View file

@ -35,7 +35,7 @@
- name: Ensure we can communicate over 8080 - name: Ensure we can communicate over 8080
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
provider: "{{ netconf }}" provider: "{{ netconf }}"
port: 8080 port: 8080
@ -43,7 +43,7 @@
- name: Ensure we can NOT communicate over default port - name: Ensure we can NOT communicate over default port
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
provider: "{{ netconf }}" provider: "{{ netconf }}"
register: result register: result
ignore_errors: true ignore_errors: true
@ -62,7 +62,7 @@
- name: Ensure we can communicate over netconf - name: Ensure we can communicate over netconf
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
provider: "{{ netconf }}" provider: "{{ netconf }}"
- debug: msg="END netconf/changeport.yaml" - debug: msg="END netconf/changeport.yaml"

View file

@ -23,7 +23,7 @@
- name: Ensure we can communicate over netconf - name: Ensure we can communicate over netconf
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
provider: "{{ netconf }}" provider: "{{ netconf }}"
# Disable netconf # Disable netconf
@ -52,7 +52,7 @@
- name: Ensure we can NOT talk via netconf - name: Ensure we can NOT talk via netconf
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
provider: "{{ netconf }}" provider: "{{ netconf }}"
register: result register: result
ignore_errors: true ignore_errors: true

View file

@ -4,14 +4,14 @@
- name: setup - name: setup
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
- delete interfaces lo0 - delete interfaces lo0
provider: "{{ netconf }}" provider: "{{ netconf }}"
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -36,7 +36,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -47,7 +47,7 @@
- name: teardown - name: teardown
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
- delete interfaces lo0 - delete interfaces lo0
provider: "{{ netconf }}" provider: "{{ netconf }}"

View file

@ -4,7 +4,7 @@
- name: setup - name: setup
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
- delete interfaces lo0 - delete interfaces lo0
provider: "{{ netconf }}" provider: "{{ netconf }}"
@ -32,7 +32,7 @@
- name: teardown - name: teardown
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
- delete interfaces lo0 - delete interfaces lo0
provider: "{{ netconf }}" provider: "{{ netconf }}"

View file

@ -4,7 +4,7 @@
- name: setup - name: setup
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
- delete interfaces lo0 - delete interfaces lo0
provider: "{{ netconf }}" provider: "{{ netconf }}"
@ -35,7 +35,7 @@
- name: teardown - name: teardown
junos_config: junos_config:
lines: lines:
- set system host-name {{ inventory_hostname }} - set system host-name {{ inventory_hostname_short }}
- delete interfaces lo0 - delete interfaces lo0
action: replace action: replace
provider: "{{ netconf }}" provider: "{{ netconf }}"

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
nxos_config: nxos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -30,7 +30,7 @@
- name: teardown - name: teardown
nxos_config: nxos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
nxos_config: nxos_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
nxos_config: nxos_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -5,7 +5,7 @@
nxos_config: nxos_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -37,7 +37,7 @@
nxos_config: nxos_config:
lines: lines:
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
nxos_config: nxos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -32,7 +32,7 @@
- name: teardown - name: teardown
nxos_config: nxos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
nxos_config: nxos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
provider: "{{ nxapi }}" provider: "{{ nxapi }}"
match: none match: none
@ -30,7 +30,7 @@
- name: teardown - name: teardown
nxos_config: nxos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
provider: "{{ nxapi }}" provider: "{{ nxapi }}"
match: none match: none

View file

@ -5,7 +5,7 @@
nxos_config: nxos_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ nxapi }}" provider: "{{ nxapi }}"
match: none match: none
@ -37,7 +37,7 @@
nxos_config: nxos_config:
lines: lines:
- "no snmp-server contact ansible" - "no snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ nxapi }}" provider: "{{ nxapi }}"
match: none match: none

View file

@ -5,7 +5,7 @@
nxos_config: nxos_config:
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ nxapi }}" provider: "{{ nxapi }}"
match: none match: none
@ -37,7 +37,7 @@
nxos_config: nxos_config:
lines: lines:
- "no snmp-server contact ansible" - "no snmp-server contact ansible"
- "hostname {{ inventory_hostname }}" - "hostname {{ inventory_hostname_short }}"
provider: "{{ nxapi }}" provider: "{{ nxapi }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
nxos_config: nxos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
provider: "{{ nxapi }}" provider: "{{ nxapi }}"
match: none match: none
@ -32,7 +32,7 @@
- name: setup - name: setup
nxos_config: nxos_config:
lines: hostname {{ inventory_hostname }} lines: hostname {{ inventory_hostname_short }}
provider: "{{ nxapi }}" provider: "{{ nxapi }}"
match: none match: none

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -14,7 +14,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost
@ -39,7 +39,7 @@
- name: collect any backup files - name: collect any backup files
find: find:
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost delegate_to: localhost

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
vyos_config: vyos_config:
lines: set system host-name {{ inventory_hostname }} lines: set system host-name {{ inventory_hostname_short }}
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -31,7 +31,7 @@
- name: teardown - name: teardown
vyos_config: vyos_config:
lines: set system host-name {{ inventory_hostname }} lines: set system host-name {{ inventory_hostname_short }}
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none

View file

@ -3,7 +3,7 @@
- name: setup - name: setup
vyos_config: vyos_config:
lines: set system host-name {{ inventory_hostname }} lines: set system host-name {{ inventory_hostname_short }}
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none
@ -30,7 +30,7 @@
- name: teardown - name: teardown
vyos_config: vyos_config:
lines: set system host-name {{ inventory_hostname }} lines: set system host-name {{ inventory_hostname_short }}
provider: "{{ cli }}" provider: "{{ cli }}"
match: none match: none