mirror of
https://github.com/lemeow125/ansible-playbooks.git
synced 2024-11-17 04:09:26 +08:00
38 lines
1 KiB
YAML
38 lines
1 KiB
YAML
---
|
|
- hosts: all
|
|
# Runs on root user already
|
|
become: false
|
|
tasks:
|
|
- name: Add SSH key to authorized_hosts - Debian/Ubuntu
|
|
authorized_key:
|
|
user: root
|
|
state: present
|
|
key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
|
path: /root/.ssh/authorized_keys
|
|
when: ansible_distribution in ["Debian", "Ubuntu"]
|
|
- name: Update all packages
|
|
apt:
|
|
update_cache: true
|
|
autoremove: true
|
|
state: latest
|
|
- name: Install packages - Debian/Ubuntu
|
|
apt:
|
|
name:
|
|
- vim
|
|
- nginx
|
|
- htop
|
|
- tmux
|
|
- samba
|
|
- docker
|
|
- docker-compose
|
|
- neofetch
|
|
- cifs-utils
|
|
- borgbackup
|
|
- curl
|
|
# Cache is already updated from previous step
|
|
update_cache: false
|
|
autoremove: true
|
|
state: latest
|
|
when: ansible_distribution in ["Debian", "Ubuntu"]
|
|
- name: Install ACME
|
|
command: curl https://get.acme.sh | sh -s email=noehbernasol0@gmail.com
|