feffi / ansible-ssh-config

Ansible role to manage ssh configs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:
  # The owner of the keys
  owner: {
    name: "feffi",
    group: "feffi"
  },
  # Destination directory of the config file
  destination: "{{ ansible_env.HOME + '/.ssh' }}"
  # SSH key pairs to publish
  keys: [
    {
        # The filename prefix of the key
        prefix: "id",
        # Private ssh key, multiline terminated with \n
        private: "...",
        # Public ssh key, multiline terminated with \n
        public: "..."
      }
  ]
  # 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" }

Example:

- hosts: all
  vars:
    ssh_config:
      # The owner of the keys
      owner:
        name: "feffi"
        group: "feffi"
      config:
        - { Host: "localhost 127.0.0.1", Hostname: "127.0.0.1", User: "root" }
    secrets:
      ssh:
        private: "..."
        public: "..."
  roles:
    - { role: ansible-ssh-config }

About

Ansible role to manage ssh configs.

License:MIT License