40 lines
2.9 KiB
YAML
40 lines
2.9 KiB
YAML
---
|
|
# Merge all apps dicts (apps + apps_group)
|
|
- name: Merge apps configurations
|
|
ansible.builtin.set_fact:
|
|
apps_all_apps: "{{ apps | default({}) | combine(apps_group | default({}), recursive=True) }}"
|
|
|
|
# Extract various lists from merged apps
|
|
- name: Build package and config lists
|
|
ansible.builtin.set_fact:
|
|
apps_packages: "{{ apps_all_apps | dict2items | selectattr('value.packages', 'defined') | map(attribute='value.packages') | flatten }}"
|
|
apps_packages_remote: "{{ apps_all_apps | dict2items | selectattr('value.packages_remote', 'defined') | map(attribute='value.packages_remote') | flatten }}"
|
|
apps_cargo: "{{ apps_all_apps | dict2items | selectattr('value.cargo', 'defined') | map(attribute='value.cargo') | flatten }}"
|
|
apps_copr: "{{ apps_all_apps | dict2items | selectattr('value.copr', 'defined') | map(attribute='value.copr') | flatten }}"
|
|
apps_git: "{{ apps_all_apps | dict2items | selectattr('value.git', 'defined') | map(attribute='value.git') | flatten }}"
|
|
apps_configs: "{{ apps_all_apps | dict2items | selectattr('value.configs', 'defined') | map(attribute='value.configs') | flatten }}"
|
|
apps_directories: "{{ apps_all_apps | dict2items | selectattr('value.directories', 'defined') | map(attribute='value.directories') | flatten }}"
|
|
apps_dnf_repos_add: "{{ apps_all_apps | dict2items | selectattr('value.dnf_repos_add', 'defined') | map(attribute='value.dnf_repos_add') | flatten }}"
|
|
apps_dnf_repofiles_add: "{{ apps_all_apps | dict2items | selectattr('value.dnf_repofiles_add', 'defined') | map(attribute='value.dnf_repofiles_add') | flatten }}"
|
|
apps_dnf_install_remote: "{{ apps_all_apps | dict2items | selectattr('value.dnf_install_remote', 'defined') | map(attribute='value.dnf_install_remote') | flatten }}"
|
|
apps_services_system_enabled: "{{ apps_all_apps | dict2items | selectattr('value.services_system_enabled', 'defined') | map(attribute='value.services_system_enabled') | flatten }}"
|
|
apps_services_system_disabled: "{{ apps_all_apps | dict2items | selectattr('value.services_system_disabled', 'defined') | map(attribute='value.services_system_disabled') | flatten }}"
|
|
apps_services_user_enabled: "{{ apps_all_apps | dict2items | selectattr('value.services_user_enabled', 'defined') | map(attribute='value.services_user_enabled') | flatten }}"
|
|
apps_services_user_disabled: "{{ apps_all_apps | dict2items | selectattr('value.services_user_disabled', 'defined') | map(attribute='value.services_user_disabled') | flatten }}"
|
|
apps_all_packages: "{{ (apps_packages | default([])) + (dnf_install | default([])) }}"
|
|
|
|
- name: Deploy repositorioes and packages
|
|
ansible.builtin.include_tasks: dnf.yml
|
|
|
|
- name: Clone git repositories
|
|
ansible.builtin.include_tasks: git.yml
|
|
|
|
- name: Install cargo packages
|
|
ansible.builtin.include_tasks: cargo.yml
|
|
|
|
- name: Deploy app configs
|
|
ansible.builtin.include_tasks: configs.yml
|
|
|
|
- name: Enable and start/stop system and user services
|
|
ansible.builtin.include_tasks: services.yml
|