Skip to content

Commit 1fedae6

Browse files
committed
ansible: Extract k5login role
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 2746a6a commit 1fedae6

File tree

4 files changed

+24
-42
lines changed

4 files changed

+24
-42
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- name: reload ssh
2+
service: name=ssh state=reloaded

ansible/roles/k5login/tasks/main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- name: Enable GSSAPIAuthentication
2+
lineinfile:
3+
path: /etc/ssh/sshd_config
4+
regexp: '(?i)^#?\s*GSSAPIAuthentication\s'
5+
line: GSSAPIAuthentication yes
6+
notify: reload ssh
7+
- name: Disable PasswordAuthentication
8+
lineinfile:
9+
path: /etc/ssh/sshd_config
10+
regexp: '(?i)^#?\s*PasswordAuthentication\s'
11+
line: PasswordAuthentication no
12+
notify: reload ssh
13+
- name: Update k5login
14+
copy:
15+
dest: /root/.k5login
16+
content: |
17+
{% for maintainer in maintainers %}
18+
{{ maintainer.username }}/[email protected]
19+
{% endfor %}

ansible/scripts-directors.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,12 @@
4848
- reconfigure munin-node
4949
- setup
5050
roles:
51+
- k5login
5152
- ldirectord-status
5253
- lvs-iptables
5354
- lvs-lighttpd
5455
- munin-node
5556
tasks:
56-
- name: Enable GSSAPIAuthentication
57-
lineinfile:
58-
path: /etc/ssh/sshd_config
59-
regexp: '(?i)^#?\s*GSSAPIAuthentication\s'
60-
line: GSSAPIAuthentication yes
61-
notify: reload ssh
62-
- name: Disable PasswordAuthentication
63-
lineinfile:
64-
path: /etc/ssh/sshd_config
65-
regexp: '(?i)^#?\s*PasswordAuthentication\s'
66-
line: PasswordAuthentication no
67-
notify: reload ssh
6857
- name: Configure rsyslog
6958
copy:
7059
dest: /etc/rsyslog.d/scripts-syslog-client.conf
@@ -111,13 +100,6 @@
111100
dest: /etc/nagios/nrpe_local.cfg
112101
src: files/nrpe_local.cfg
113102
notify: restart nrpe
114-
- name: Update k5login
115-
copy:
116-
dest: /root/.k5login
117-
content: |
118-
{% for maintainer in maintainers %}
119-
{{ maintainer.username }}/[email protected]
120-
{% endfor %}
121103
- name: Update /etc/aliases
122104
lineinfile:
123105
path: /etc/aliases
@@ -179,8 +161,6 @@
179161
dest: /etc/ha.d/ldirectord.cf
180162
src: files/ldirectord.cf
181163
handlers:
182-
- name: reload ssh
183-
service: name=ssh state=reloaded
184164
- name: restart rsyslog
185165
service: name=rsyslog state=restarted
186166
- name: newaliases

ansible/scripts-syslog.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
- hosts: scripts-syslogs
22
serial: 1
3+
roles:
4+
- k5login
35
tasks:
46
- name: Configure Kerberos
57
debconf: name=krb5-config question=krb5-config/default_realm vtype=string value=ATHENA.MIT.EDU
@@ -17,25 +19,6 @@
1719
- libzephyr4-krb5
1820
- zephyr-clients
1921
- aptitude
20-
- name: Update k5login
21-
copy:
22-
dest: /root/.k5login
23-
content: |
24-
{% for maintainer in maintainers %}
25-
{{ maintainer.username }}/[email protected]
26-
{% endfor %}
27-
- name: Enable GSSAPIAuthentication
28-
lineinfile:
29-
path: /etc/ssh/sshd_config
30-
regexp: '(?i)^#?\s*GSSAPIAuthentication\s'
31-
line: GSSAPIAuthentication yes
32-
notify: reload ssh
33-
- name: Disable PasswordAuthentication
34-
lineinfile:
35-
path: /etc/ssh/sshd_config
36-
regexp: '(?i)^#?\s*PasswordAuthentication\s'
37-
line: PasswordAuthentication no
38-
notify: reload ssh
3922
- name: Update /etc/aliases
4023
lineinfile:
4124
path: /etc/aliases
@@ -104,8 +87,6 @@
10487
notify: restart rsyslog
10588

10689
handlers:
107-
- name: reload ssh
108-
service: name=ssh state=reloaded
10990
- name: newaliases
11091
command: newaliases
11192
- name: reload systemd

0 commit comments

Comments
 (0)