Ansible/setup/user_setup.yml

15 lines
356 B
YAML

---
- name: Setup ansible configuration for new host
hosts: all
tasks:
- name: Add 'ansible' system user and setup SSH key
become: yes
user:
name: ansible
comment: Automation user for ansible
system: True
create_home: False
generate_ssh_key: yes
ssh_key_bits: 4096
ssh_key_file: /etc/ansible/.id_rsa