ssh
[Ansible][ansible] role to configure ssh and manage known hosts.
Tests
| Family | Distribution | Version | Test Status |
|---|---|---|---|
| Debian | Debian | Jessie | |
| Debian | Debian | Wheezy | |
| Debian | Ubuntu | Yakkety | |
| Debian | Ubuntu | Xenial | |
| Debian | Ubuntu | Vivid | |
| Debian | Ubuntu | Trusty | |
| Debian | Ubuntu | Precise |
Requirements
- ansible >= 2.0
Role Variables
- debug: flag to run debug tasks.
- ssh_config:
ssh_configfile configuration. - ssh_config_path: path to
ssh_configfile. - ssh_config_user: contents of the
~user/.ssh/configfor each user. - ssh_known_hosts_global_scan: list of hostname that after a
keyscanare added to the globalssh_known_hostsfile. - ssh_known_hosts_global_path: path to the
ssh_known_hostsfile. - ssh_known_hosts_user_scan: list of hostnames that after a
keyscanare added to the user'sknown_hostsfile.
Dependencies
None.
Playbooks
- hosts: servers
vars:
ssh_config_user:
vagrant: |
Host github.com
IdentityFile ~/.ssh/deploy
ssh_known_hosts_global_scan:
- github.com
ssh_known_hosts_user_scan:
- user: vagrant
hosts:
- bitbucket.com
roles:
- role: ssh
Tags
- configuration: configuration tasks.
- debug: task to debug role variables.
- installation: installation tasks.
- validation: task to validate role variables.
Test
To run the tests you will need to install:
To run all tests against all pre-defined OS/distributions * ansible versions:
$ tox
To run tests for trusty64:
$ cd tests
$ bash test_idempotence.sh --box trusty64.vagrant.dev
# log file will be stores under tests/log
To perform debugging on a specific environment:
$ cd tests
$ vagrant up trusty64.vagrant.dev
# to provision using the test.yml playbook (as many time as you need)
$ vagrant provision trusty64.vagrant.dev
# to access the Vagrant box
$ vagrant ssh trusty64.vagrant.dev
