30 lines
719 B
YAML
30 lines
719 B
YAML
---
|
|
- name: Post install configuration
|
|
hosts: all
|
|
become: true # Use this if you need sudo privileges
|
|
tasks:
|
|
|
|
- name: Update and Upgrade all packages
|
|
apt:
|
|
update_cache: yes
|
|
upgrade: dist
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- name: create ansible user
|
|
user:
|
|
name: ansible
|
|
shell: '/bin/bash'
|
|
|
|
- name: Install public keys
|
|
authorized_key:
|
|
user: ansible
|
|
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINxwwGO69n2Ljbip4h43T4SRgzRu6iaUPWXR/R25rPjr ansible@ubuntu03"
|
|
|
|
- name: add ansible to sudoers
|
|
copy:
|
|
src: sudoer_ansible
|
|
dest: /etc/sudoers.d/ansible
|
|
owner: root
|
|
group: root
|
|
mode: 0440
|