deployAnsible.yml
448 Bytes
---
- hosts: new-host
become: true
tasks:
- name: Deploy Ansible User
command: useradd -m -c "ansible user" -s /bin/bash -U ansible --uid 1111
- name: Grant Permission
command: usermod -aG sudo ansible
- copy:
src: /tmp/configuration/authorized_keys
dest: /home/ansible/.ssh/authorized_keys
owner: ansible
group: ansible
mode: 0600