Can you write me an ansible playbook that distributes a given ssh key to all servers in…
- User
Can you write me an ansible playbook that distributes a given ssh key to all servers in a cluster?
Assistant
Sure, here is an Ansible playbook that distributes a given SSH key to all servers in a cluster:
- hosts: all become: yes tasks: - name: Copy SSH key to all servers copy: src: /path/to/ssh_key.pub dest: ~/.ssh/authorized_keys owner: root group: root mode: 0600 handlers: - name: Restart SSH service service: name: sshd state: restarted
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.