ssh
is an ansible role which:
- installs openssh (client/server)
- configures ssh
- adds known_hosts
- configures server
Using ansible-galaxy
:
$ ansible-galaxy install franklinkim.ssh
Using requirements.yml
:
- src: franklinkim.ssh
Using git
:
$ git clone https://github.com/weareinteractive/ansible-ssh.git franklinkim.ssh
- Ansible 1.9
- sshknownhosts module
Here is a list of all the default variables for this role, which are also available in defaults/main.yml
.
# ssh_known_hosts:
# - github.com
# - name: github.com
# key: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
#
# what ports, IPs and protocols we listen for
ssh_port: [22]
ssh_protocol: 2
ssh_listen_address: []
# authentication
ssh_permit_root_login: 'yes'
ssh_pubkey_authentication: 'yes'
ssh_password_authentication: 'yes'
# start on boot
ssh_service_enabled: yes
# current state: started, stopped
ssh_service_state: started
# system wide known hosts
ssh_known_hosts: []
These are the handlers that are defined in handlers/main.yml
.
restart ssh
- host: all
sudo: yes
roles:
- franklinkim.ssh
vars:
ssh_port:
- 22
ssh_permit_root_login: 'no'
ssh_pubkey_authentication: 'yes'
ssh_password_authentication: 'yes'
ssh_known_hosts:
- github.com
- bitbucket.org
$ git clone https://github.com/weareinteractive/ansible-ssh.git
$ cd ansible-ssh
$ vagrant up
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright (c) We Are Interactive under the MIT license.