prompt for path

This commit is contained in:
eneller
2025-04-23 11:25:26 +02:00
parent c5ec3e8f5c
commit 9733adc14b
2 changed files with 6 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ forks = 20
callbacks_enabled = timer, profile_tasks, profile_roles callbacks_enabled = timer, profile_tasks, profile_roles
# reduce number of parallel ssh connections to one host # reduce number of parallel ssh connections to one host
pipelining = True pipelining = True
interpreter_python = auto_silent
[ssh_connection] [ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=40s ssh_args = -o ControlMaster=auto -o ControlPersist=40s
# (boolean) By default Ansible will issue a warning when received from a task action (module or action plugin) # (boolean) By default Ansible will issue a warning when received from a task action (module or action plugin)

View File

@@ -3,6 +3,10 @@
- name: update ssh key and login permissions - name: update ssh key and login permissions
strategy: free # dont wait for other hosts when executing strategy: free # dont wait for other hosts when executing
hosts: oracleServer hosts: oracleServer
vars_prompt:
- name: ssh_key_path
prompt: enter the path to the ssh key to add:
private: false
tasks: tasks:
- name: Add ssh key - name: Add ssh key
@@ -13,7 +17,7 @@
user: "{{ ansible_user_id }}" user: "{{ ansible_user_id }}"
exclusive: true exclusive: true
state: present state: present
key: "{{ lookup('file', '~/.ssh/id_ed25519.pub') }}" key: "{{ lookup('file', '{{ ssh_key_path }}') }}"
- name: sshd configuration file update - name: sshd configuration file update
blockinfile: blockinfile: