prompt for path
This commit is contained in:
@@ -7,6 +7,7 @@ forks = 20
|
||||
callbacks_enabled = timer, profile_tasks, profile_roles
|
||||
# reduce number of parallel ssh connections to one host
|
||||
pipelining = True
|
||||
interpreter_python = auto_silent
|
||||
[ssh_connection]
|
||||
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)
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
- name: update ssh key and login permissions
|
||||
strategy: free # dont wait for other hosts when executing
|
||||
hosts: oracleServer
|
||||
vars_prompt:
|
||||
- name: ssh_key_path
|
||||
prompt: enter the path to the ssh key to add:
|
||||
private: false
|
||||
tasks:
|
||||
|
||||
- name: Add ssh key
|
||||
@@ -13,7 +17,7 @@
|
||||
user: "{{ ansible_user_id }}"
|
||||
exclusive: true
|
||||
state: present
|
||||
key: "{{ lookup('file', '~/.ssh/id_ed25519.pub') }}"
|
||||
key: "{{ lookup('file', '{{ ssh_key_path }}') }}"
|
||||
|
||||
- name: sshd configuration file update
|
||||
blockinfile:
|
||||
|
||||
Reference in New Issue
Block a user