Generates key pairs and manages SSH configuration for Mac OS X development.
OpenSSH must be installed on the system prior to running this role,
specifically key management programs ssh-agent
, ssh-add
and ssh-keygen
.
OpenSSH is pre-installed on Mac OS X version 10.1 and later.
Available variables with example values are listed below, for default values see
defaults/main.yml
):
ssh_keys_dir: "{{ ansible_env.HOME }}/.ssh"
ssh_keys_pairs:
default:
type: rsa
bits: 4096
path: "{{ ssh_keys_dir }}/id_rsa"
email: "user@example.org"
password: "The ships hung in the sky in much the same way that bricks don’t."
github:
- { label: example, token: example }
bitbucket:
- { label: example, password: example, user: example }
ssh_keys_config:
- host: "example"
config:
- [ "HostName", "example.org" ]
- host: "example.dev"
config:
- [ "HostName", "111.222.333.444" ]
- host: "*.io"
config:
- [ "IdentityFile", "{{ ssh_keys_dir }}/id_rsa" ]
- [ "User", "io" ]
- host: "*"
config:
- [ "AddKeysToAgent", "yes" ]
- [ "UseKeychain", "yes" ]
- [ "User", "example" ]
None.
- hosts: localhost
roles:
- { role: lwalley.ssh-keys }
MIT