{"id":16994775,"url":"https://github.com/znerol/ansible-role-ssh-kba","last_synced_at":"2026-05-11T03:04:41.578Z","repository":{"id":136255477,"uuid":"184783933","full_name":"znerol/ansible-role-ssh-kba","owner":"znerol","description":"Setup SSH public key authentication for machine to machine communication.","archived":false,"fork":false,"pushed_at":"2022-02-06T21:59:32.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T06:28:25.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/znerol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-03T16:01:56.000Z","updated_at":"2022-02-17T21:58:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ea3d528-2c76-4162-8740-af1abf3e664d","html_url":"https://github.com/znerol/ansible-role-ssh-kba","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2Fansible-role-ssh-kba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2Fansible-role-ssh-kba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2Fansible-role-ssh-kba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2Fansible-role-ssh-kba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/znerol","download_url":"https://codeload.github.com/znerol/ansible-role-ssh-kba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244913005,"owners_count":20530769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T03:46:29.713Z","updated_at":"2026-05-11T03:04:36.539Z","avatar_url":"https://github.com/znerol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Role Name\n=========\n\n[![Build Status](https://travis-ci.org/znerol/ansible-role-ssh-kba.svg?branch=master)](https://travis-ci.org/znerol/ansible-role-ssh-kba)\n\nSetup SSH public key authentication for machine to machine communication.\n\nRequirements\n------------\n\nOpenSSH server and client software present.\n\nRole Variables\n--------------\n\nIn a typical setup this role is applied either to an SSH client or an SSH\nserver.  Tasks for the other side can be delegated by setting\n`ssh_kba_server_hostname` and `ssh_kba_client_hostname` respectively. Also in\nmost cases it is recommended to specify `ssh_kba_server_user` and\n`ssh_kba_client_user` explicitely instead of relying on the defaults.\n\nNote: SSH host keys are collected from ansible facts. Thus it is important that\nthey are gathered beforehand for all involved machines.\n\n### Variables affecting the server\n\nHost and user representing the server side enpoint of the public key\nauthenticated ssh connection:\n\n```\nssh_kba_server_hostname: \"{{ inventory_hostname }}\"\nssh_kba_server_user: # Ansible user on the server according to facts.\n```\n\n### Variables affecting the client\n\n```\nssh_kba_client_hostname: \"{{ inventory_hostname }}\"\nssh_kba_client_user: # Ansible user on the server according to facts.\n```\n\n```\nssh_kba_client_host_fqdn: # FQDN of the server according to facts.\nssh_kba_client_host_ip4: # Default IP address of the server according to facts.\nssh_kba_client_host_ip6: # Default IP address of the server according to facts.\n\n```\n\n### Variables affecting the keypair\n\n```\nssh_kba_keypair_type: rsa # One of dsa, ecdsa, ed25519, rsa\nssh_kba_keypair_size: # Omit by default\nssh_kba_keypair_comment: \"{{ ssh_kba_client_user }}@{{ ssh_kba_client_hostname }}\"\nssh_kba_keypair_dir: ~/.ssh\nssh_kba_keypair_name: \"id_{{ ssh_kba_keypair_type }}\"\nssh_kba_keypair_path: \"{{ ssh_kba_keypair_dir }}/{{ ssh_kba_keypair_name }}\"\nssh_kba_keypair_owner: \"{{ ssh_kba_client_user }}\"\nssh_kba_keypair_group: # Omit by default\nssh_kba_keypair_attributes: # Omit by default\nssh_kba_keypair_selevel: # Omit by default\nssh_kba_keypair_serole: # Omit by default\nssh_kba_keypair_setype: # Omit by default\nssh_kba_keypair_seuser: # Omit by default\n```\n\nThe keypair will be regenerated if `ssh_kba_keypair_force` is set to `yes`.\n\n```\nssh_kba_keypair_force: # Omit by default\n```\n\nThe fact `ssh_kba_keypair_pub` is set to the public part of the keypair during\nrole evaluation.\n\n### Variables affecting the servers authorized keys file\n\n```\nssh_kba_keypair_pub: # see keypair section above\nssh_kba_server_authorized_keys_owner: \"{{ ssh_kba_server_user }}\"\nssh_kba_server_authorized_keys_comment: # Omit by default\nssh_kba_server_authorized_keys_exclusive: # Omit by default\nssh_kba_server_authorized_keys_key_options: # Omit by default\nssh_kba_server_authorized_keys_manage_dir: # Omit by default\nssh_kba_server_authorized_keys_path: # Omit by default\n```\n\n### Variables affecting the clients known hosts file\n\n```\nssh_kba_client_known_hosts_owner: \"{{ ssh_kba_client_user }}\"\nssh_kba_client_known_hosts_hash_host | default(omit) }}\"\nssh_kba_client_known_hosts_path | default(omit) }}\"\n```\n\nServer FQDN, IPs and host key facts are collected in order to make them\navailable in the clients `known_hosts`. Overriding any of the following\nvariables will modify this behavior:\n\n```\nssh_kba_server_host_fqdn: # FQDN of the server according to facts.\nssh_kba_server_host_ip4: # Default IP address of the server according to facts.\nssh_kba_server_host_ip6: # Default IP address of the server according to facts.\nssh_kba_server_host_names: # A list consisting of FQDN and default IP addresses.\nssh_kba_server_host_keys: # A list of pairs, each one consisting of the key\n    type (first field) and the actual host key (second field). Defaults to\n    values available from host facts.\n```\n\nThe afforementioned variables will be used to populate a variable with a list\nof host names and keys:\n\n```\nssh_kba_server_host_names_and_keys: # A list of pairs, each one consisting of a\n    hostname (or ip address) and a corresponding host key (in the form which is\n    accepted by the known_hosts module)\n```\n\n\nDependencies\n------------\n\nNone.\n\nExample Playbook\n----------------\n\n    - hosts: server.example.com\n      tasks:\n        - name: Gather client facts\n          delegate: client.example.com\n          delegate_facts: yes\n          setup:\n\n        - name: \u003e-\n            Key based authentication granted to beta@client.example.com on\n            alpha@server.example.com\n          vars:\n            ssh_kba_server_user: alpha\n            ssh_kba_client_hostname: client.example.com\n            ssh_kba_client_user: beta\n          import_role:\n            name: znerol.ssh_kba\n\nLicense\n-------\n\nBSD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznerol%2Fansible-role-ssh-kba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fznerol%2Fansible-role-ssh-kba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznerol%2Fansible-role-ssh-kba/lists"}