vps/playbooks/update-services.yml

26 lines
728 B
YAML
Raw Normal View History

2024-03-02 12:03:14 +01:00
- name: Include variables files
2024-02-17 19:01:04 +01:00
hosts: localhost
roles:
- include-vars
- name: Update project(s)
hosts: localhost
vars:
docker_pull_images: true
run_update: true
2024-02-17 19:01:04 +01:00
vars_prompt:
- name: selected_projects
prompt: "Choose projects to update (Keep empty to update all. Projects list: {{ hostvars['localhost']['projects'] }})"
private: false
unsafe: true
tasks:
- name: Update project(s)
include_role:
2024-02-17 19:05:39 +01:00
name: "{{ project }}"
loop: "{{ (selected_projects | split) | default(projects, true) }}"
2024-02-17 19:01:04 +01:00
loop_control:
# Do not use default variable name 'item' to prevent collisions with loops in roles.
loop_var: project
when: project in projects