Skip to content

Instantly share code, notes, and snippets.

@edlee123
edlee123 / docker_install.yml
Last active January 23, 2025 19:49
docker_install
# 1. Install Ansible
# sudo apt update
# sudo apt install software-properties-common
# sudo add-apt-repository --yes --update ppa:ansible/ansible
# sudo apt install ansible -y
# 2.
# sudo ansible-playbook docker_install.yml
---
@stylersnico
stylersnico / debian-update.yml
Created November 3, 2024 09:15
Update and reboot Debian host if needed with ansible and needrestart
- hosts: debian
become: yes
become_method: sudo
tasks:
- name: updates a server
apt: update_cache=yes
- name: upgrade a server
apt: upgrade=dist dpkg_options='force-confold,force-confdef'
@peterschristoph
peterschristoph / pbs-playbook.yml
Created October 27, 2024 22:39
Ansible Configure Proxmox Backup Server PBS
---
- name: Configure Proxmox Backup Server (PBS)
hosts: localhost
connection: local
vars:
proxmox_pbs_api_url: "https://yourpbs.tld:8007/api2/json"
proxmox_pbs_username: "root@pam"
proxmox_pbs_password: "rootpassword"
proxmox_pbs_verify_ssl: true
zfs_pool_name: "your_zfs_and_datastore_name"
@jlxq0
jlxq0 / playbook.yaml
Created October 23, 2024 09:53
An ansible playbook for some basic preparation of a new Ubuntu 24.04 LTS base install before installing k3s
---
- name: Prepare nodes
hosts: k3s02
become: true
tasks:
- name: Set hostname
hostname:
name: "{{ inventory_hostname }}"
- name: Set timezone
timezone:
---
- name: setup gitea container
tasks:
- name: create gitea directory
ansible.builtin.file:
path: ./gitea
- name: create directory for data and config
ansible.builtin.file:
@fluggelgleckheimlen
fluggelgleckheimlen / redfish.yml
Created October 8, 2024 09:37
Get bios attributes via redfish
- name: Get redfish info
hosts: localhost
gather_facts: no
vars:
baseuri: "10.10.10.10"
username: "<user>"
password: "<password>"
host_ips:
- "10.10.10.11"
- "10.10.10.12"
@jonayed-hossan-gazi
jonayed-hossan-gazi / playbook.yml
Created October 5, 2024 11:10
ansible playbook haproxy installer
---
- name: Install and Configure Haproxy
hosts: redis_mysql
become: yes
tasks:
- name: Enable Software Poperties Support
apt:
name: software-properties-common
install_recommends: yes
state: present
@snowman11784
snowman11784 / capture_keys_list_from_file.yml
Created October 5, 2024 03:35
Ansible - Capture list of custom vars keys from file
- name: Capture list of custom vars keys from file
ansible.builtin.set_fact:
_my_vars:
"{{ lookup('ansible.builtin.file', 'vars/custom_vars.yml') |
from_yaml | dict2items | selectattr('key', 'defined') |
map(attribute='key') }}"
- name: Debug vars
ansible.builtin.debug:
msg: "{{ _my_vars }}"
---
- name: Install Git from source on ubuntu
hosts: localhost
become: true
vars:
git_version: "2.43.0"
git_download_url: "https://www.kernel.org/pub/software/scm/git/git-{{ git_version }}.tar.gz"
git_install_path: "/usr/local"
@camaeel
camaeel / ansible-apt-repo.yml
Created August 18, 2024 20:13
Ansible apt repo "new way"
- name: Add repos
deb822_repository:
name: "{{ item.name }}"
types: "{{ item.repo.split()[0] }}"
uris: "{{ item.repo.split()[1] }}"
suites: "{{ item.repo.split()[2] }}"
components: "{{ item.repo.split()[3] }}"
architectures: "{{ item.architecture | default(omit) }}"
signed_by: "{{ item.key }}"
loop: