ssh_config

Collection: community.general

Full Name: parallax.community.general.ssh_config

Aliases: community.general.ssh_config, ssh_config

Synopsis

Manage host entries in an SSH client config file

Parameters

NameTypeRequiredDefaultDescription
hoststringyesThe host alias for the SSH config entry
hostnamestringThe actual hostname to connect to
userstringThe username to use for the connection
identity_filestringThe path to the SSH identity file (private key)
portstringThe SSH port to connect to
statestringpresentWhether the host entry should be present or absent Choices: present, absent
ssh_config_filestring~/.ssh/configPath to the SSH config file
strict_host_key_checkingstringStrictHostKeyChecking option Choices: yes, no, ask
proxycommandstringProxyCommand to use for the connection
remote_userstringThe remote user (alias for user parameter)

Example

- name: Add a jump host entry for the deploy user
  ssh_config:
    host: bastion
    hostname: bastion.example.com
    user: deploy
    port: "2222"
    identity_file: /home/deploy/.ssh/id_ed25519
    state: present