home-infra/tasks/base.yml

36 lines
777 B
YAML
Raw Permalink Normal View History

2022-04-07 21:35:41 +01:00
- 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