Ansible role to manage ssh configs.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
defaults
meta
tasks
templates
tests
.gitignore
.travis.yml
LICENSE
README.md

README.md

ansible-ssh-config

Ansible role to manage ssh configs.

Build Status Github All Releases GitHub forks GitHub stars GitHub watchers Twitter Follow License

Role Defaults Variables

# Sections and key-value pairs to include in the users .ssh-config
ssh_config:
  # Destination directory of the config file
  destination: "{{ ansible_env.HOME + '/.ssh' }}"

  # Sections and key-value pairs to include in the users .gitconfig
  config:
    - { Host: "localhost 127.0.0.1", Hostname: "127.0.0.1", User: "root" }

secrets:
  ssh:
    # Private ssh key, multiline terminated with \n
    private: ""

    # Public ssh key, multiline terminated with \n
    public: ""

Example:

- hosts: all
  vars:
    ssh_config:
      config:
        - { Host: "localhost 127.0.0.1", Hostname: "127.0.0.1", User: "root" }
    secrets:
      ssh:
        private: "-----BEGIN RSA PRIVATE KEY-----\n
MIIBOAIBAAJAbO38dp/t36o48N1ydDv5cNe+fL/sEJ1zDFdUetoOv6VP1eqGDNMs\n
8SvhOYR/ry/Lv5ldofonC8P0JckBhNiNJwIDAQABAkAsGIMU+lTvMBdw2hRVHVoy\n
5gNEuOS1LSe/nTKjsNY7mgZZQ83D1f3zgdpBK6fkcPoMda5vNedWx+2uT+2tn1Zx\n
AiEAtzXu/6vbnvcb6yhFj76JaUfiA0n4oBappZ2I5uExRT0CIQCYNQu53yo3Xj6v\n
p7N0LNqpIFpI8mTadQrTGBbEEZbqMwIgUrM+yhw6i9xBtvm7xLIedu6iwBdQ6nqw\n
Y3jkBkwaoIUCIHbgDy13R3CA8fKcxsJ4ebrXoswQTIZ2HSMrUDSIDFcTAiA4BR7m\n
KfKkfU4gSp5KI1WpQMClE3FMneNYrbbsZKdZ3w==\n
-----END RSA PRIVATE KEY-----\n"
        public: "-----BEGIN PUBLIC KEY-----\n
MFswDQYJKoZIhvcNAQEBBQADSgAwRwJAbO38dp/t36o48N1ydDv5cNe+fL/sEJ1z\n
DFdUetoOv6VP1eqGDNMs8SvhOYR/ry/Lv5ldofonC8P0JckBhNiNJwIDAQAB\n
-----END PUBLIC KEY-----\n"
  roles:
    - { role: feffi.ssh-config }