Migrated to ansible

This commit is contained in:
2024-04-02 00:59:42 +02:00
parent c53268e307
commit 0ccf6427f2
136 changed files with 5157 additions and 1407 deletions

40
main.yml Normal file
View File

@@ -0,0 +1,40 @@
---
- name: Dotfiles
hosts: localhost
connection: local
tasks:
- name: Set default roles
set_fact:
roles: "{{ ansible_run_tags != ['all'] and ansible_run_tags or default_roles | difference(ansible_skip_tags | default([])) }}"
tags:
- always
- name: Set desktop roles
set_fact:
roles: "{{ (desktop_roles + roles) | difference(ansible_skip_tags | default([])) }}"
tags:
- always
when: system != 'server' and desktop_roles is defined and ansible_run_tags == ['all']
- name: Prepend system role
set_fact:
roles: "{{ ['system'] | difference(roles) + roles }}"
tags:
- always
- name: Display roles
debug: "var=roles"
tags:
- always
- name: Run roles
include_role:
apply:
tags:
- "{{ roles_item }}"
name: "{{ roles_item }}"
loop_control:
loop_var: roles_item
with_items: "{{ roles }}"
tags:
- always