infra/ansible/roles/ubuntu/tasks/main.yml
2026-01-30 17:27:52 -06:00

42 lines
899 B
YAML

---
- 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: Remove ubuntu advantage
ansible.builtin.apt:
autoremove: true
autoclean: true
state: absent
name:
- ubuntu-advantage-tools
# - 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