7eab57ab1e
This role is an attempt to allow self-service SSH access to nodes. Change-Id: Icb6fb50b779c0bf2296e14436e4746355703f2ae
29 lines
665 B
YAML
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
|