Manages hostname resource module
Version added: 4.1.0
- This module configures and manages the attribute of hostname on Arista EOS platforms.
Note
- Tested against Arista EOS 4.24.60M
- This module works with connection
network_cli
. See the EOS Platform Options.
# Using state: merged
# Before state:
# -------------
# test#show running-config | section ^hostname
# hostname eos
# Merged play:
# ------------
- name: Apply the provided configuration
arista.eos.eos_hostname:
config:
hostname: eos
state: merged
# Commands Fired:
# ---------------
# "commands": [
# "hostname eos",
# ],
# After state:
# ------------
# test#show running-config | section ^hostname
# hostname eos
# Using state: deleted
# Before state:
# -------------
# test#show running-config | section ^hostname
# hostname eosTest
# Deleted play:
# -------------
- name: Remove all existing configuration
arista.eos.eos_hostname:
state: deleted
# Commands Fired:
# ---------------
# "commands": [
# "no hostname eosTest",
# ],
# After state:
# ------------
# test#show running-config | section ^hostname
# hostname eos
# Using state: overridden
# Before state:
# -------------
# test#show running-config | section ^hostname
# hostname eos
# Overridden play:
# ----------------
- name: Override commands with provided configuration
arista.eos.eos_hostname:
config:
hostname: eosTest
state: overridden
# Commands Fired:
# ---------------
# "commands": [
# "hostname eosTest",
# ],
# After state:
# ------------
# test#show running-config | section ^hostname
# hostname eosTest
# Using state: replaced
# Before state:
# -------------
# test#show running-config | section ^hostname
# hostname eosTest
# Replaced play:
# --------------
- name: Replace commands with provided configuration
arista.eos.eos_hostname:
config:
hostname: eosTest
state: replaced
# Commands Fired:
# ---------------
# "commands": [],
# After state:
# ------------
# test#show running-config | section ^hostname
# hostname eosTest
# Using state: gathered
# Before state:
# -------------
# test#show running-config | section ^hostname
# hostname eosTest
# Gathered play:
# --------------
- name: Gather listed hostname config
arista.eos.eos_hostname:
state: gathered
# Module Execution Result:
# ------------------------
# "gathered": {
# "hostname": "eosTest"
# },
# Using state: rendered
# Rendered play:
# --------------
- name: Render the commands for provided configuration
arista.eos.eos_hostname:
config:
hostname: eosTest
state: rendered
# Module Execution Result:
# ------------------------
# "rendered": [
# "hostname eosTest",
# ]
# Using state: parsed
# File: parsed.cfg
# ----------------
# hostname eosTest
# Parsed play:
# ------------
- name: Parse the provided configuration with the existing running configuration
arista.eos.eos_hostname:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
# "parsed": {
# "hostname": "eosTest"
# }
Common return values are documented here, the following are the fields unique to this module:
- Gomathi Selvi Srinivasan (@GomathiselviS)