90 lines
1.4 KiB
YAML
90 lines
1.4 KiB
YAML
|
---
|
||
|
# vim: set expandtab tabstop=2 shiftwidth=2:
|
||
|
|
||
|
- name: packages
|
||
|
apk:
|
||
|
update_cache: yes
|
||
|
name:
|
||
|
- vim
|
||
|
- ncdu
|
||
|
- htop
|
||
|
- tmux
|
||
|
- etckeeper
|
||
|
- syslog-ng
|
||
|
- zsh
|
||
|
- curl
|
||
|
- lsof
|
||
|
- knot-utils
|
||
|
- krb5
|
||
|
- apk-cron
|
||
|
- msmtp
|
||
|
- openssh-sftp-server
|
||
|
- python3
|
||
|
- name: upgrade
|
||
|
apk:
|
||
|
upgrade: yes
|
||
|
|
||
|
- include_tasks: sshd_config.yml
|
||
|
|
||
|
- name: create user syslog
|
||
|
register: _cruser
|
||
|
shell: |
|
||
|
getent passwd syslog
|
||
|
case $? in
|
||
|
0) exit 42 ;;
|
||
|
2) ;;
|
||
|
esac
|
||
|
adduser -S syslog
|
||
|
failed_when: '_cruser.rc not in [0,42]'
|
||
|
changed_when: '_cruser.rc == 0'
|
||
|
|
||
|
- name: create group syslog
|
||
|
register: _crgroup
|
||
|
shell: |
|
||
|
getent group syslog
|
||
|
case $? in
|
||
|
0) exit 42 ;;
|
||
|
2) ;;
|
||
|
esac
|
||
|
addgroup -S syslog
|
||
|
failed_when: '_crgroup.rc not in [0,42]'
|
||
|
changed_when: '_crgroup.rc == 0'
|
||
|
|
||
|
- name: Set timezone variables
|
||
|
file:
|
||
|
src: '/etc/zoneinfo/{{timezone}}'
|
||
|
dest: /etc/localtime
|
||
|
state: link
|
||
|
force: yes
|
||
|
|
||
|
- name: setup msmtp
|
||
|
template:
|
||
|
dest: /etc/msmtprc
|
||
|
src: msmtprc.j2
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0644
|
||
|
|
||
|
- name: 'vi -> vim'
|
||
|
file:
|
||
|
dest: /usr/bin/vi
|
||
|
src: vim
|
||
|
state: link
|
||
|
force: yes
|
||
|
|
||
|
- name: 'python -> python3'
|
||
|
file:
|
||
|
dest: /usr/bin/python
|
||
|
src: python3
|
||
|
state: link
|
||
|
force: yes
|
||
|
|
||
|
- name: enable services
|
||
|
service:
|
||
|
name: '{{item}}'
|
||
|
enabled: yes
|
||
|
state: restarted
|
||
|
with_items:
|
||
|
- sshd
|
||
|
- syslog-ng
|