Hello,
I have a playbook and inventory list. I will run a task for only one host from inventory list. Is there any way to do this?
- hosts: eos_switches
connection: local
tasks:
-
name: Gather Show Version Facts
eos_command:
commands: -
‘show version’
register: showvers -
debug:
var: showvers -
name: Create vlan
eos_vlan:
vlan_id: 4091
name: CONNECTION-P2P
state: present -
name: configure interface
eos_interface:
name: ethernet1
description: CONNECTION-P2P
speed: 100full
mtu: 1500 -
name: Ensure Ethernet1 is a trunk port
eos_l2_interface:
name: Ethernet1
mode: trunk
native_vlan: 1
trunk_allowed_vlans: 4091 -
name: Set ethernet1 IPv4 address
eos_l3_interface:
provider:
host: eos_switches[‘192.168.81.139’]
transport: eapi
use_ssl: yes
validate_certs: no
username: eapi
password: icantellyou
name: vlan4091
ipv4: 192.168.0.1/30 -
name: Set ethernet1 IPv4 address_2
eos_l3_interface:
provider:
host: eos_switches[‘192.168.81.140’]
transport: eapi
use_ssl: yes
validate_certs: no
username: eapi
password: icantellyou
name: vlan4091
ipv4: 192.168.0.2/30