Skip to content

Commit e0447b8

Browse files
authored
ansible 2.x fixes (#4)
Change sudo to become Added Debian 9(stretch) ignore errors on removing local known_hosts
1 parent 6923536 commit e0447b8

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

handlers/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
- name: gen ssh keys
33
command: ssh-keygen -A
4+
become: true
45

56
- name: restart ssh
67
service: name={{ssh_service_name}} state=restarted
8+
become: true

meta/main.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
---
22
galaxy_info:
33
author: Ryan Yates
4-
description: Role for managing ntp.
4+
description: Role for managing ssh.
55
company:
66
license: license (Apache 2.0)
7-
min_ansible_version: 1.5
7+
min_ansible_version: 2.2
88
platforms:
99
- name: Ubuntu
1010
versions:
1111
- precise
1212
- trusty
13+
- xenial
1314
- name: Debian
1415
versions:
15-
- squeeze
1616
- wheezy
17+
- jessie
18+
- stretch
1719
- name: EL
1820
versions:
1921
- 6
2022
- 7
21-
- name: Fedora
22-
versions:
23-
- 19
24-
- 20
2523
categories:
2624
- system
2725
dependencies: []

tasks/ssh.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
owner=root
1515
group=root
1616
mode=0600
17+
become: true
1718
notify:
1819
- gen ssh keys
1920
- restart ssh
2021

22+
# Ignore errors on this as it isn't reliable
2123
- name: Attempt to remove pub key from local known_hosts
2224
local_action: command ssh-keygen -f "$HOME/.ssh/known_hosts" -R hostname
23-
sudo: no
25+
become: false
26+
ignore_errors: true

vars/Debian-9.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
ssh_service_name: ssh
3+
sshd_config_file: sshd_config.j2

0 commit comments

Comments
 (0)