Skip to content

netconf

Collection Note

This module is part of the ansible.netcommon collection. To install the collection, use:

ansible-galaxy collection install ansible.netcommon
Added in version 1.0.0.

You need further requirements to be able to use this module, see the Requirements section for details.

Synopsis

  • This connection plugin provides a connection to remote devices over the SSH NETCONF subsystem. This connection plugin is typically used by network devices for sending and receiving RPC calls over NETCONF.
  • Note this connection plugin requires ncclient to be installed on the local Ansible controller.

Requirements

The following Python packages are needed on the host that executes this module:

Parameters

Parameter Defaults / Choices Comments
host
string
Default: inventory_hostname
Specifies the remote device FQDN or IP address to establish the SSH connection to.
host_key_checking
boolean
Default: True
Set this to "False" if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host
Env: ANSIBLE_HOST_KEY_CHECKING
Env: ANSIBLE_SSH_HOST_KEY_CHECKING
Env: ANSIBLE_NETCONF_HOST_KEY_CHECKING
import_modules
boolean
Default: True
Reduce CPU usage and network module execution time by enabling direct execution. Instead of the module being packaged and executed by the shell, it will be directly executed by the Ansible control node using the same python interpreter as the Ansible process. Note- Incompatible with C(asynchronous mode). Note- Python 3 and Ansible 2.9.16 or greater required. Note- With Ansible 2.9.x fully qualified modules names are required in tasks.
Env: ANSIBLE_NETWORK_IMPORT_MODULES
look_for_keys
boolean
Default: True
Enables looking for ssh keys in the usual locations for ssh keys (e.g. :file:`~/.ssh/id_*`).
Env: ANSIBLE_PARAMIKO_LOOK_FOR_KEYS
netconf_ssh_config
string
This variable is used to enable bastion/jump host with netconf connection. If set to True the bastion/jump host ssh settings should be present in ~/.ssh/config file, alternatively it can be set to custom ssh configuration file path to read the bastion/jump host settings.
Env: ANSIBLE_NETCONF_SSH_CONFIG
network_os
string
Configures the device platform network operating system. This value is used to load a device specific netconf plugin. If this option is not configured (or set to C(auto)), then Ansible will attempt to guess the correct network_os to use. If it can not guess a network_os correctly it will use C(default).
password
string
Configures the user password used to authenticate to the remote device when first establishing the SSH connection.
persistent_command_timeout
int
Default: 30
Configures, in seconds, the amount of time to wait for a command to return from the remote device. If this timer is exceeded before the command returns, the connection plugin will raise an exception and close.
Env: ANSIBLE_PERSISTENT_COMMAND_TIMEOUT
persistent_connect_timeout
int
Default: 30
Configures, in seconds, the amount of time to wait when trying to initially establish a persistent connection. If this value expires before the connection to the remote device is completed, the connection will fail.
Env: ANSIBLE_PERSISTENT_CONNECT_TIMEOUT
persistent_log_messages
boolean
This flag will enable logging the command executed and response received from target device in the ansible log file. For this option to work 'log_path' ansible configuration option is required to be set to a file path with write access.
Be sure to fully understand the security implications of enabling this option as it could create a security vulnerability by logging sensitive information in log file.
Env: ANSIBLE_PERSISTENT_LOG_MESSAGES
port
int
Default: 830
Specifies the port on the remote device that listens for connections when establishing the SSH connection.
Env: ANSIBLE_REMOTE_PORT
private_key_file
string
The private SSH key or certificate file used to authenticate to the remote device when first establishing the SSH connection.
Env: ANSIBLE_PRIVATE_KEY_FILE
proxy_command
string
Proxy information for running the connection via a jumphost.
This requires ncclient >= 0.6.10 to be installed on the controller.
Env: ANSIBLE_NETCONF_PROXY_COMMAND
remote_user
string
The username used to authenticate to the remote device when the SSH connection is first established. If the remote_user is not specified, the connection will use the username of the logged in user.
Can be configured from the CLI via the C(--user) or C(-u) options.
Env: ANSIBLE_REMOTE_USER

Authors

  • Ansible Networking Team (@ansible-Network)