-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsite.yml
More file actions
113 lines (100 loc) · 3.43 KB
/
Copy pathsite.yml
File metadata and controls
113 lines (100 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
# Development Environment Automation Playbook
#
# This playbook installs and configures a complete modern development stack
# including shell tools, programming languages, containers, and utilities.
#
# Usage Examples:
# # Install everything on all hosts
# ansible-playbook -i inventory/hosts site.yml
#
# # Install only specific components
# ansible-playbook -i inventory/hosts site.yml --tags "base,docker"
#
# # Skip certain components
# ansible-playbook -i inventory/hosts site.yml --skip-tags "networking"
#
# # Target specific host groups
# ansible-playbook -i inventory/hosts site.yml --limit "development"
#
# Expected Inventory Groups:
# - all: All managed hosts (default target)
# - development: Development workstations and laptops
# - servers: Production/staging servers
# - testing: CI/CD and testing environments
#
# Prerequisites:
# 1. Install role dependencies: ansible-galaxy install -r requirements.yml
# 2. Configure inventory file with target hosts
# 3. Ensure SSH access and sudo privileges on target hosts
# Common tags used across roles
common_tags: &common_tags ['base', 'system']
development_tags: &dev_tags ['development', 'toolchain']
networking_tags: &net_tags ['networking', 'security']
shell_tags: &shell_tags ['shell', 'terminal']
- hosts: all
gather_facts: "{{ gather_facts | default(true) }}"
gather_subset:
- '!all'
- network
- hardware
- virtual
strategy: "{{ (parallel_execution_enabled | default(true)) | ternary('free', 'linear') }}"
serial: "{{ serial | default(1) }}"
max_fail_percentage: "{{ max_fail_percentage | default(0) }}"
pre_tasks:
# System readiness validation
- name: Validate system readiness
ansible.builtin.include_role:
name: common
tasks_from: system_readiness.yml
when:
- performance_optimization_enabled | default(true) | bool
- system_readiness_validation | default(true) | bool
tags:
- always
- performance
- system-validation
# Centralized package cache management to prevent redundant updates across roles
- name: Update package cache once with TTL
become: yes
ansible.builtin.apt:
update_cache: yes
cache_valid_time: "{{ common_cache_valid_time | default(3600) }}"
when:
- performance_optimization_enabled | default(true) | bool
- centralized_cache_management | default(true) | bool
- ansible_os_family | lower == 'debian'
tags:
- always
- performance
- cache-management
# Centralized fact gathering using existing state_management infrastructure
- name: Gather all facts centrally
ansible.builtin.include_role:
name: common
tasks_from: state_management.yml
when:
- performance_optimization_enabled | default(true) | bool
- centralized_fact_gathering | default(true) | bool
tags:
- always
- performance
- fact-gathering
roles:
- role: common
tags: [*common_tags, 'common']
- role: fish
tags: [*shell_tags, 'fish']
- role: rust
tags: [*dev_tags, 'rust']
- role: docker
tags: [*dev_tags, 'docker', 'containers']
- role: tailscale
tags: [*net_tags, 'tailscale']
- role: cli_tools
tags: [*dev_tags, 'cli', 'tools']
- role: configs
tags: [*common_tags, 'configs', 'dotfiles']
- role: atuin
tags: [*shell_tags, 'atuin', 'history']