servers/roles/alpine/tasks/main.yml
Timotej Lazar c2c1fdbe40 Add alpine role
Base packages and SSH config, and QEMU guest agent for VMs.
2024-05-19 14:21:22 +02:00

44 lines
919 B
YAML

- name: Enable community package repo
lineinfile:
path: /etc/apk/repositories
regexp: '^# *(http.*/v[^/]*/community)'
line: '\1'
backrefs: yes
notify: update package cache
- meta: flush_handlers
- name: Install base packages
package:
name:
- git
- procps
- rsync
- tmux
- vim
- name: Disable SSH password authentication
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^#?{{ item.key }}'
line: '{{ item.key }} {{ item.value }}'
loop:
- key: PasswordAuthentication
value: 'no'
- key: PermitRootLogin
value: 'prohibit-password'
notify: reload sshd
- name: Enable QEMU guest agent
when: is_virtual
block:
- name: Install QEMU guest agent package
package:
name: qemu-guest-agent
- name: Enable QEMU guest agent service
service:
name: qemu-guest-agent
enabled: yes
state: started