infra/ansible/roles/ubuntu/tasks/main.yml
2025-05-30 13:24:38 -05:00

70 lines
1.4 KiB
YAML
Executable file

---
- name: "Enable passwordless sudo on Ubuntu"
ansible.builtin.lineinfile:
path: /etc/sudoers
state: present
regexp: "^%sudo"
line: "%sudo ALL=(ALL) NOPASSWD: ALL"
validate: "visudo -cf %s"
- name: "Install updates on Ubuntu"
ansible.builtin.apt:
name: "*"
state: latest
update_cache: true
cache_valid_time: 0
force_apt_get: true
autoremove: true
autoclean: true
- name: Install required software
ansible.builtin.apt:
autoremove: true
autoclean: true
state: present
name:
- lsof
- htop
- mosh
- rsync
- tmux
- unattended-upgrades
- silversearcher-ag
- net-tools
- locate
- fail2ban
- munin-node
- nethogs
- pv
- fzf
- qemu-guest-agent
- name: Remove ubuntu advantage
ansible.builtin.apt:
autoremove: true
autoclean: true
state: absent
name:
- ubuntu-advantage-tools
- name: Create a user for andys
ansible.builtin.user:
name: andy
groups:
- sudo
state: present
# - name: Allow SSH in ufw
# community.general.ufw:
# rule: limit
# port: ssh
# proto: tcp
# - name: Allow localhost in ufw
# community.general.ufw:
# rule: allow
# from_ip: 172.27.0.0/16
# - name: Allow everything and enable UFW
# community.general.ufw:
# state: enabled
# policy: allow