diff --git a/ansible.cfg b/ansible.cfg index 0125b60..5307e3f 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -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) diff --git a/ssh_updateKey.yml b/ssh_updateKey.yml index 04205e5..a686e8f 100644 --- a/ssh_updateKey.yml +++ b/ssh_updateKey.yml @@ -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: