Answers for "Ansible ssh key distribution"

0

Ansible ssh key distribution

---

- hosts: testfileservers
  remote_user: devopuser
 
  tasks:

  - name: Read variables
    include_vars: '{{ item }}'
    with_first_found:
      - files:
          - "{{ inventory_hostname }}.yml"
          - "default.yml"
        paths: "./vars/"

  - name: Deploy SSH-Keys to remote host
    authorized_key:
      user: functionaccount
      key: "{{ keystodeploy|map(attribute='sshkey')|join('\n') }}"
      exclusive: true
Posted by: Guest on April-07-2022

Browse Popular Code Answers by Language