Clint Byrum 7eab57ab1e intercept-job -- self-service SSH access
This role is an attempt to allow self-service SSH access to nodes.

Change-Id: Icb6fb50b779c0bf2296e14436e4746355703f2ae
2021-04-23 15:14:06 +00:00

29 lines
665 B
YAML

- name: Slurp it
slurp:
path: "{{ intercept_job_pub_key_path }}"
register: intercept_key
- name: Add to current user
authorized_key:
key: "{{ intercept_key.content|b64decode }}"
user: "{{ ansible_user }}"
- name: Inform user of connection details
debug:
msg: "ssh {{ ansible_ssh_user }}@{{ ansible_ssh_host }}"
- name: Copy waiter script
copy:
src: waiter.sh
dest: ./waiter.sh
mode: "0755"
- name: Start waiter task
command: ./waiter.sh {{ intercept_job_stop_path }}
- name: Remove key from current user
authorized_key:
key: "{{ intercept_key.content|b64decode }}"
user: "{{ ansible_user }}"
state: absent