Files
sukaato-ansible/install@vps.yml
2025-07-07 20:35:13 -04:00

38 lines
1.2 KiB
YAML

---
- name: Bootstrap virtual private server
hosts: vps
gather_facts: yes
vars:
# # below is just to remind you to use '-u' instead
# ansible_user: "{{ admin_auths[0].username }}"
# # below is just to remind you to use '--ask-pass' instead
# ansible_password: "{{ admin_auths[0].password }}"
FAMILY: "{{ ansible_facts['os_family'] }}"
CORE_PKGS: "core_pkgs@{{ ansible_facts['os_family'] }}.yml"
want_extra_pkgs: yes
tasks:
- name: Install core packages
become: yes
become_method: sudo
block:
- name: Install native packages
include_role:
name: bootstrap
tasks_from: "core_installations.yml"
defaults_from: "{{ CORE_PKGS }}"
tags: ['native_pkgs']
- name: Install foreign packages
include_role:
name: bootstrap
tasks_from: "core_installations@{{ FAMILY }}.yml"
defaults_from: "{{ CORE_PKGS }}"
handlers_from: "update@{{ family }}.yml"
tags: ['foreign_pkgs']
register: core_done
tags: ['default', 'core']
- name: Install additional packages
block: ~
register: extra_pkgs_done
when: want_extra_pkgs
tags: ['extra_pkgs']