-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlocal.yml
More file actions
executable file
·47 lines (40 loc) · 1.08 KB
/
local.yml
File metadata and controls
executable file
·47 lines (40 loc) · 1.08 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
---
- name: Tareas previas al deploy de roles
hosts: laptop
become: true
vars:
target_profile: "{{ profile_override | default('funcional') }}"
# --- TAREAS PREVIAS ---
pre_tasks:
- name: "Asegurar que /tmp tenga los permisos correctos (1777)"
tags: always
ansible.builtin.file:
path: /tmp
state: directory
mode: '1777'
- name: Actualizar caché de paquetes
tags: always
ansible.builtin.apt:
update_cache: true
changed_when: false
# --- SECCIÓN DE ROLES ---
roles:
- role: "{{ target_profile }}"
# Este rol SOLO se ejecuta si se pide explícitamente la etiqueta 'deploy'.
- role: deploy
tags:
- deploy
- never
# --- TAREAS POSTERIORES ---
post_tasks:
- name: Limpiar paquetes huérfanos (con purge)
tags: always
ansible.builtin.apt:
autoremove: true
purge: true
changed_when: false
- name: Limpiar el caché de paquetes descargados
tags: always
ansible.builtin.apt:
autoclean: true
changed_when: false