Add first playbooks

This commit is contained in:
Keannu Bernasol 2024-10-25 17:35:21 +08:00
parent 15738b747e
commit 364b3d4881
5 changed files with 55 additions and 3 deletions

4
.gitignore vendored
View file

@ -165,4 +165,6 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
**/__pycache__/
**/__pycache__/
.vscode/

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"ansible.python.interpreterPath": "c:\\Users\\keannu125\\AppData\\Local\\Programs\\Python\\Python311\\python.exe"
}

View file

@ -1,3 +1,3 @@
10.0.10.4
10.0.10.141
10.0.10.64
10.0.10.64
10.0.10.141

35
setup.yml Normal file
View file

@ -0,0 +1,35 @@
---
- hosts: all
# Runs on root user already
become: false
tasks:
- name: Add SSH key to authorized_hosts
authorized_key:
user: root
state: present
key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
path: /root/.ssh/authorized_keys
- name: Update all packages
apt:
update_cache: true
autoremove: true
state: latest
- name: Install packages
apt:
name:
- vim
- nginx
- htop
- tmux
- samba
- docker
- docker-compose
- neofetch
- cifs-utils
- curl
update_cache: false
autoremove: true
state: latest
- name: Install ACME
command: curl https://get.acme.sh | sh -s email=noehbernasol0@gmail.com

12
update.yml Normal file
View file

@ -0,0 +1,12 @@
---
- hosts: all
# Runs on root user already
become: false
tasks:
- name: Update all packages
apt:
update_cache: true
autoremove: true
state: latest
- name: Update ACME
command: /root/.acme.sh/acme.sh --upgrade --auto-upgrade