Skip to content

Commit 9bb02b6

Browse files
author
Federico Ceratto
committed
Add known_hosts creation, minor fixes
1 parent fff0d16 commit 9bb02b6

File tree

5 files changed

+31
-21
lines changed

5 files changed

+31
-21
lines changed

ansible/inventory

-3
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,6 @@ staticiforme.torproject.org # tor LDAP
201201
[no_nodeexp:children]
202202
no_passwd # no passwd => no nodeexp user ;-)
203203

204-
[fastpath]
205-
fastpath.ooni.nu
206-
207204
########################################################################
208205
# TO DELETE.
209206
# Stopped VMs that should be deleted from GH and DNS after some grace period:

ansible/roles/fastpath/tasks/main.yml

+23-16
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,34 @@
1111
# Usage: place the .deb file in files/
1212
# update the version number as needed
1313

14-
- name: copy fastpath .deb package
15-
copy:
16-
src: files/fastpath_0.1_all.deb
17-
dest: /root/
18-
owner: root
19-
group: root
20-
mode: '0644'
21-
22-
# Leave a copy of the .deb in /root as an emergency backup for rollbacks
14+
#- name: pull fastpath .deb package
15+
# copy:
16+
# src: files/fastpath_0.1_all.deb
17+
# dest: /root/
18+
# owner: root
19+
# group: root
20+
# mode: '0644'
2321

24-
- name: install .deb using dpkg
25-
apt:
26-
deb: '{{ item }}'
27-
state: present
28-
with_items:
29-
- /root/fastpath_0.1_all.deb
22+
#- name: install .deb using dpkg
23+
# apt:
24+
# deb: '{{ item }}'
25+
# state: present
26+
# with_items:
27+
# - /root/fastpath_0.1_all.deb
3028

31-
- name: generate fastpath.conf file with collectors
29+
- name: generate fastpath.conf file with active collectors names in it
3230
template:
3331
owner: "root"
3432
group: "root"
3533
mode: '0644'
3634
src: "fastpath.conf.j2"
3735
dest: "/etc/fastpath.conf"
36+
37+
- name: fill active collectors SSH pubkeys into fastpath's known_hosts
38+
template:
39+
owner: "fastpath"
40+
group: "fastpath"
41+
mode: '0644'
42+
src: "known_collectors"
43+
dest: /var/lib/fastpath/ssh/known_hosts
44+
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Deployed by ansible
1+
# Deployed by https://github.com/ooni/sysadmin/blob/master/ansible/roles/fastpath
22
# deploy-fastpath.yml
33
# roles/fastpath/tasks/main.yml
44
# roles/fastpath/templates/fastpath.conf.j2
55

66
[DEFAULT]
7-
collectors = {{ groups['have_collector'] | join(' ') }}
7+
collectors = {{ groups['active_collector'] | join(' ') }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Deployed by https://github.com/ooni/sysadmin/blob/master/ansible/roles/fastpath/templates/known_collectors
2+
{% for host in groups.active_collector %}
3+
{{ lookup('pipe', 'grep -F -e {}, {}/../ext/known_hosts'.format(host, inventory_dir)) }}
4+
{% endfor %}

ansible/roles/ooni-collector/tasks/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@
151151
shell: /bin/bash
152152
home: "/home/sshfeeder"
153153
system: no
154+
tags: collector_ssh
154155

155156
- name: Set authorized key for sshfeeder
156157
authorized_key:
157158
user: sshfeeder
158159
state: present
159160
key: "{{ sshfeeder_key }}"
161+
tags: collector_ssh

0 commit comments

Comments
 (0)