36 lines
777 B
YAML
36 lines
777 B
YAML
|
- name: Update packages
|
||
|
apt:
|
||
|
update_cache: yes
|
||
|
upgrade: yes
|
||
|
state: latest
|
||
|
|
||
|
- name: Install essential packages
|
||
|
apt:
|
||
|
pkg: "{{ packages }}"
|
||
|
update_cache: yes
|
||
|
state: latest
|
||
|
|
||
|
- name: Add the user "{{ username }}"
|
||
|
user:
|
||
|
name: "{{ username }}"
|
||
|
shell: /bin/bash
|
||
|
groups: sudo
|
||
|
append: yes
|
||
|
|
||
|
- name: Set authorized ssh key for user "{{ username }}"
|
||
|
authorized_key:
|
||
|
user: "{{ username }}"
|
||
|
state: present
|
||
|
key: "{{ lookup('file', '/home/noble/.ssh/nexus-to-pi.pub') }}"
|
||
|
|
||
|
- name: Enable passwordless sudo for ansible
|
||
|
lineinfile:
|
||
|
path: /etc/sudoers
|
||
|
state: present
|
||
|
regexp: '^ansible'
|
||
|
line: 'ansible ALL=(ALL) NOPASSWD:ALL'
|
||
|
validate: /usr/sbin/visudo -cf %s
|
||
|
|
||
|
- name: Set hostname to void
|
||
|
hostname:
|
||
|
name: void
|