Skip to content

Commit

Permalink
add 'tor_' var prefix (#77)
Browse files Browse the repository at this point in the history
dupcount -> tor_dupkeycount
currentsomaxconn -> tor_currentsomaxconn
currentnmbc -> tor_currentnmbc
currentlimits -> tor_openbsd_maxfiles
  • Loading branch information
nusenu committed Feb 19, 2017
1 parent 55aafd1 commit 0a70204
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
shell: openssl sha256 -r {{ tor_offline_masterkey_dir }}/*/keys/secret_id_key {{ tor_offline_masterkey_dir }}/*/keys/ed25519_master_id_secret_key|cut -d' ' -f1|sort|uniq -d|wc -l
delegate_to: 127.0.0.1
run_once: true
register: dupcount
register: tor_dupkeycount

- name: Abort on duplicate relay keys
fail: msg="Duplicate relay key detected! Aborting."
run_once: true
when: dupcount.stdout|int(1) != 0
when: tor_dupkeycount.stdout|int(1) != 0

- name: Detect if Ed25519 master keys are on the relay
become: yes
Expand Down
8 changes: 4 additions & 4 deletions tasks/freebsd_prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: Gather current kern.ipc.somaxconn setting (FreeBSD)
shell: "sysctl kern.ipc.somaxconn|cut -d' ' -f2"
become: no
register: currentsomaxconn
register: tor_currentsomaxconn

- name: Ensure somaxconn setting is reasonable (FreeBSD)
become: yes
Expand All @@ -20,12 +20,12 @@
value: "{{ tor_freebsd_somaxconn }}"
reload: no
sysctl_set: yes
when: currentsomaxconn.stdout|int < {{ tor_freebsd_somaxconn }}
when: tor_currentsomaxconn.stdout|int < {{ tor_freebsd_somaxconn }}

- name: Gather current kern.ipc.nmbclusters setting (FreeBSD)
become: no
shell: "sysctl kern.ipc.nmbclusters|cut -d' ' -f2"
register: currentnmbc
register: tor_currentnmbc

- name: Ensure nmbclusters setting is reasonable (FreeBSD)
become: yes
Expand All @@ -34,4 +34,4 @@
value: "{{ tor_freebsd_nmbclusters }}"
reload: no
sysctl_set: yes
when: currentnmbc.stdout|int < {{ tor_freebsd_nmbclusters }}
when: tor_currentnmbc.stdout|int < {{ tor_freebsd_nmbclusters }}
6 changes: 3 additions & 3 deletions tasks/openbsd_prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
- name: Gather current system-wide file descriptor limits (OpenBSD)
shell: "sysctl kern.maxfiles|cut -d= -f2"
become: no
register: currentlimits
register: tor_openbsd_maxfiles

- name: Ensure system-wide runtime file descriptor limits are reasonable (OpenBSD)
become: yes
command: "sysctl kern.maxfiles=20000"
when: currentlimits.stdout|int < 20000
when: tor_openbsd_maxfiles.stdout|int < 20000

- name: Ensure system-wide persistent file descriptor limits are reasonable (OpenBSD)
become: yes
Expand All @@ -17,7 +17,7 @@
regexp: ^kern.maxfiles
line: "kern.maxfiles=20000"
create: yes
when: currentlimits.stdout|int < 20000
when: tor_openbsd_maxfiles.stdout|int < 20000

# We rise openfiles limits for every tor instance separately.
# An instance is identified by its rc.d file name.
Expand Down

0 comments on commit 0a70204

Please sign in to comment.