Skip to content

Commit

Permalink
ansible 2.x fixes (#4)
Browse files Browse the repository at this point in the history
Change sudo to become
Added Debian 9(stretch)
ignore errors on removing local known_hosts
  • Loading branch information
yatesr authored Sep 23, 2017
1 parent 6923536 commit e0447b8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
- name: gen ssh keys
command: ssh-keygen -A
become: true

- name: restart ssh
service: name={{ssh_service_name}} state=restarted
become: true
12 changes: 5 additions & 7 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
---
galaxy_info:
author: Ryan Yates
description: Role for managing ntp.
description: Role for managing ssh.
company:
license: license (Apache 2.0)
min_ansible_version: 1.5
min_ansible_version: 2.2
platforms:
- name: Ubuntu
versions:
- precise
- trusty
- xenial
- name: Debian
versions:
- squeeze
- wheezy
- jessie
- stretch
- name: EL
versions:
- 6
- 7
- name: Fedora
versions:
- 19
- 20
categories:
- system
dependencies: []
Expand Down
5 changes: 4 additions & 1 deletion tasks/ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
owner=root
group=root
mode=0600
become: true
notify:
- gen ssh keys
- restart ssh

# Ignore errors on this as it isn't reliable
- name: Attempt to remove pub key from local known_hosts
local_action: command ssh-keygen -f "$HOME/.ssh/known_hosts" -R hostname
sudo: no
become: false
ignore_errors: true
3 changes: 3 additions & 0 deletions vars/Debian-9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
ssh_service_name: ssh
sshd_config_file: sshd_config.j2

0 comments on commit e0447b8

Please sign in to comment.