22 lines
503 B
YAML
22 lines
503 B
YAML
---
|
|
- name: Create ansible user
|
|
user:
|
|
name: "{{ bootstrap.user.name }}"
|
|
password: "{{ bootstrap.user.password }}"
|
|
shell: /bin/bash
|
|
groups: sudo
|
|
create_home: yes
|
|
state: present
|
|
|
|
- name: Add public ssh key
|
|
authorized_key:
|
|
user: "{{ bootstrap.user.name }}"
|
|
key: "{{ bootstrap.user.public_ssh_key }}"
|
|
|
|
- name: Enable ansible user to run sudo without password
|
|
copy:
|
|
src: ansible.sudoers
|
|
dest: /etc/sudoers.d/ansible
|
|
owner: root
|
|
group: root
|
|
mode: 0440 |