Commit 89e3cc25 authored by bbguimaraes's avatar bbguimaraes
Browse files

ansible: use groups

parent 17c581b0
- hosts: all
- hosts: bbguimaraes.com
tasks:
- name: check if user centos exists
command: getent passwd centos
......@@ -33,7 +33,7 @@
service:
state: restarted
name: fail2ban
- hosts: all
- hosts: bbguimaraes.com
tags: pkgs
tasks:
- name: install packages
......
- hosts: all
- hosts: bbguimaraes.com
tasks:
- name: add Nextcloud cron job
cron:
......
- hosts: all
- hosts: bbguimaraes.com
vars:
pkgs:
- podman
......
- hosts: all
- hosts: bbguimaraes.com
tasks:
- name: format the filesystem
when: volume_format_disk|default(false)
......
[desktops]
tjobim
rmanzarek
rh0
[servers]
bbguimaraes.com
[raspberry_pis]
tenochtitlan
[arch]
tjobim
rmanzarek
rh0
[personal]
tjobim
rmanzarek
[work]
rh0
#!/bin/bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
ansible-playbook \
--inventory localhost, \
--connection local \
--become \
ansible/install.yaml \
"$@"
- hosts: all
tags: base_sys_pkgs
tasks:
- name: install base system packages
package:
state: present
name: "{{ item }}"
with_items:
- grub
- os-prober
- hosts: all
- hosts: desktops:&arch
tags: base_pkgs
vars:
pkgs:
......@@ -56,7 +46,7 @@
- name: install base packages
package:
name: '{{ (pkgs|join(" ")).split(" ") }}'
- hosts: all
- hosts: desktops:&arch
tasks:
- name: enable/start services
service:
......@@ -68,7 +58,7 @@
name: dev.i915.perf_stream_paranoid
value: '0'
state: present
- hosts: all
- hosts: desktops:&arch
tags: aurutils
vars:
user: bbguimaraes
......@@ -137,7 +127,7 @@
Server = file://{{ aurutils_repo }}
- name: update pacman cache
command: pacman -Sy
- hosts: all
- hosts: desktops:&arch
tags: misc
tasks:
- name: disable pulseaudio esound module
......
- hosts: all
- hosts: desktops
tasks:
- name: add udev rule
copy:
......
- hosts: all
- hosts: desktops:&arch
tasks:
- block:
- import_tasks: ../aur.yaml
......
- hosts: all
- hosts: desktops
vars:
home: "{{ ansible_env.HOME }}"
profile_path: "{{ home }}/.nix-profile"
......
- hosts: swap
- hosts: all
vars:
swapfile_path: /var/swapfile
swapfile_size_kb: 4096
......
- hosts: all
- hosts: desktops
tags: base
vars:
home: '{{ ansible_env.HOME }}'
......@@ -107,7 +107,7 @@
- proton-bridge
- redshift
- vdirsyncer
- hosts: all
- hosts: desktops
tags: urxvt
vars:
home: '{{ ansible_env.HOME }}'
......@@ -121,7 +121,7 @@
state: link
src: '{{ home }}/.urxvt/ext/urxvt-resize-font/resize-font'
dest: '{{ home }}/.urxvt/ext/resize-font'
- hosts: all
- hosts: desktops
tags: weechat
vars:
dir: '{{ ansible_env.HOME }}/.weechat'
......@@ -180,7 +180,7 @@
section: format
opt: buffer_current
val: '${format_number}${indent}${color:*white,}${name}'
- hosts: all
- hosts: desktops
name: aur pkgs
tags: aur
tasks:
......
#!/bin/bash
set -euo pipefail
ansible-playbook \
--inventory localhost, \
--connection local \
ansible/user/user.yaml \
"$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment