Skip to content

Commit

Permalink
fix: adjust path to 'cleaner' home directory to make ssh work
Browse files Browse the repository at this point in the history
Otherwise the `authorized_keys` files will be in the wrong place
which breaks password-less authentication (which is needed for
copying the drop directory to one of the cleansers).

Refs: acf220e
  • Loading branch information
witsch committed Jan 8, 2025
1 parent d45e7fc commit 155f2a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deployment/jailhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ def reset_jails(confirm=True, keep_cleanser_master=True):
for jail in jails:
fab.run('ezjail-admin delete -fw {jail}'.format(jail=jail))
# remove authorized keys for no longer existing key (they are regenerated for each new worker)
fab.run('rm /usr/jails/cleanser/usr/home/cleanser/.ssh/authorized_keys')
fab.run('rm /usr/jails/cleanser/home/cleanser/.ssh/authorized_keys')
10 changes: 5 additions & 5 deletions deployment/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
createhome: yes
- name: create cleanser .ssh
file:
path: /usr/home/cleanser/.ssh
path: /home/cleanser/.ssh
owner: cleanser
mode: "700"
state: directory
Expand All @@ -73,12 +73,12 @@
tags: cleanser_clones
# grant worker's pyramid user ssh access
- name: copy keyfile
command: cp {{ jails_dir }}/worker/home/pyramid/.ssh/id_rsa.pub {{ jails_dir }}/cleanser/usr/home/cleanser/.ssh/authorized_keys
command: cp {{ jails_dir }}/worker/home/pyramid/.ssh/id_rsa.pub {{ jails_dir }}/cleanser/home/cleanser/.ssh/authorized_keys
args:
creates: "{{ jails_dir }}/cleanser/usr/home/cleanser/.ssh/authorized_keys"
creates: "{{ jails_dir }}/cleanser/home/cleanser/.ssh/authorized_keys"
tags: cleanser_clones
- name: fix permissions on keyfile
command: chmod 600 {{ jails_dir }}/cleanser/usr/home/cleanser/.ssh/authorized_keys
command: chmod 600 {{ jails_dir }}/cleanser/home/cleanser/.ssh/authorized_keys
tags: cleanser_clones
- name: read ssh pub host key
shell: sed -E -e 's:[^ ]+$::' {{ jails_dir }}/cleanser/etc/ssh/ssh_host_rsa_key.pub
Expand All @@ -103,7 +103,7 @@
user: root
tasks:
- name: ensure ownership of scripts
command: chown -R cleanser /usr/home/cleanser
command: chown -R cleanser /home/cleanser
tags: cleanser_clones
- name: Upload cleanser scripts
copy:
Expand Down

0 comments on commit 155f2a1

Please sign in to comment.