initial commit

This commit is contained in:
Faris Mektem 2024-03-29 14:01:50 +00:00
commit b944e990d3
4 changed files with 274 additions and 0 deletions

84
debian-desktop.yml Executable file
View File

@ -0,0 +1,84 @@
- name: setup debian with gnome
hosts: localhost
become: true
tasks:
- name: update apt and install gui apps
ansible.builtin.apt:
pkg:
- audacity
- blender
- cura
- firefox-esr
- gimp
- inkscape
- kiwix
- libreoffice
- libreoffice-gnome
- monero
- mpv
- obs-studio
- retroarch
- thunderbird
#- torbrowser-launcher
#- ttf-mscore-fonts-installer
- virt-manager
#gnome
- gnome-core
- gnome-tweaks
state: latest
update_cache: true
- name: install terminal apps
ansible.builtin.apt:
pkg:
- ansible
- cataclysm-dda-curses
- cifs-utils
- cmatrix
- curl
- exiftool
- ffmpeg
- fzf
- git
- gnupg
- htop
- iperf3
- lm-sensors
- neofetch
- neovim
- nmap
- mediainfo
- qrencode
- smartmontools
- telnet
- tmux
- wget
- yt-dlp
- xxd
- name: install signal
block:
- name: get signal key
ansible.builtin.get_url:
url: https://updates.signal.org/desktop/apt/keys.asc
dest: /etc/apt/keyrings/signal.asc
- name: install signal key
ansible.builtin.apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/signal.asc] https://updates.signal.org/desktop/apt xenial main"
state: present
- name: install signal package
ansible.builtin.apt:
pkg:
- signal-desktop
update_cache: true
- name: install discord
block:
- name: get discord.deb
ansible.builtin.get_url:
url: https://discord.com/api/download?platform=linux&format=deb
dest: /tmp/discord.deb
- name: install discord.deb
ansible.builtin.apt:
deb: /tmp/discord.deb
#- name: reboot
#ansible.builtin.reboot:

50
debian-docker.yml Executable file
View File

@ -0,0 +1,50 @@
---
- hosts: localhost
become: true
tasks:
- name: mount data nfs
ansible.posix.mount:
path: /mnt/share
src: 192.168.0.20:/mnt/pool/data
fstype: nfs
opts: defaults,auto,rw
state: present
- name: mount media nfs
ansible.posix.mount:
path: /mnt/media
src: 192.168.0.20:/mnt/pool/media
fstype: nfs
opts: defaults,auto,rw
state: present
- name: Update apt and install gui apps
apt:
pkg:
- ansible
- curl
- git
- tmux
- docker
- docker-compose
- neovim
- fzf
state: latest
update_cache: true
- name: setup backup
ansible.builtin.cron:
minute: "0"
hour: "4"
name: "backup"
user: "root"
job: "/bin/bash '/mnt/share/services/scripts/backup.sh'"
cron_file: backup
- name: start docker main
become: true
ansible.builtin.shell:
cmd: "docker-compose -f docker-compose.yml up -d"
chdir: /mnt/share/services/docker/
- name: delay startup of machine by 30 secs
ansible.builtin.shell: |
echo '[Service]
ExecStartPre/bin/sleep 30' > /etc/systemd/system/docker.service.d/override.conf # syemctl edit docker.server

19
inventory/hosts.yml Executable file
View File

@ -0,0 +1,19 @@
playground:
hosts:
192.168.0.21:
macbook:
hosts:
192.168.0.18:
windows:
hosts:
192.168.122.49:
debian-docker:
hosts:
pve:
ansible_host: 192.168.0.10
debian:
ansible_host: 192.168.0.30

121
macos.yml Executable file
View File

@ -0,0 +1,121 @@
---
- name: Install MacOS Packages
hosts: localhost
become: false
vars:
brew_cask_packages:
- audacity
- bitwarden
- blender
- brave-browser
- calibre
- discord
- firefox
- gimp
- inkscape
- iterm2
- jellyfin-media-player
- joplin
- kiwix
- libreoffice
- monero-wallet
- mpv
- nextcloud
- obs
- protonvpn
- retroarch
- signal
- the-unarchiver
- tor-browser
- transmission
- ultimaker-cura
- via
brew_packages:
- ansible
- ffmpeg
- fzf
- git
- htop
- irssi
- neovim
- newsboat
- nmap
- tmux
- yt-dlp
# python_modules:
# - configparser
# - pylint
# - virtualenv
upgrade_homebrew_packages: false
pre_tasks:
- name: Ensuring Homebrew Is Installed
stat:
path: /opt/homebrew/bin/brew
register: homebrew_check
- name: Fail If Homebrew Is Not Installed and install_homebrew_if_missing Is False
fail:
msg: Homebrew is missing...Install from http://brew.sh/
when:
- not homebrew_check.stat.exists
- name: Installing Homebrew
shell: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
when:
- not homebrew_check.stat.exists
tasks:
- name: Updating Homebrew
homebrew:
update_homebrew: true
when: homebrew_check.stat.exists
- name: Upgrading Homebrew Packages
homebrew:
upgrade_all: "{{ upgrade_homebrew_packages }}"
register: result
until: result is successful
when: homebrew_check.stat.exists
- name: Installing Homebrew Cask Packages
homebrew_cask:
name: "{{ brew_cask_packages }}"
state: present
register: result
until: result is successful
when: homebrew_check.stat.exists
- name: Installing Homebrew Packages
homebrew:
name: "{{ brew_packages }}"
state: present
register: result
until: result is successful
when: homebrew_check.stat.exists
# - name: Installing Python Modules
# pip:
# name: "{{ item }}"
# state: present
# with_items: '{{ python_modules }}'
# - name: Install xcode
# ansible.builtin.shell:
# cmd: sudo xcode-select --install
- name: Add cronjob to run weekly
ansible.builtin.cron:
name: "ansible"
minute: "28"
hour: "21"
job: "ansible-playbook /Users/admin/macos2.yml"
- name: Dock
ansible.builtin.shell: |
dockutil --remove all
dockutil --add /Applications/Firefox.app --position 1
dockutil --add /Applications/Thunderbird.app --position 2
dockutil --add /Applications/Joplin.app --position 3
dockutil --add /Applications/Signal.app --position 4
dockutil --add /Applications/Discord.app --position 5
dockutil --add /Applications/Calculator.app --position 6
dockutil --add /Applications/iTerm.app --position 7
dockutil --add "/Applications/System Settings.app" --position 8