30 lines
835 B
YAML
30 lines
835 B
YAML
- name: Include variables files
|
|
hosts: localhost
|
|
roles:
|
|
- include-vars
|
|
|
|
- name: Update project(s)
|
|
hosts: localhost
|
|
vars:
|
|
run_backup: false
|
|
run_update: true
|
|
vars_prompt:
|
|
- name: selected_projects
|
|
prompt: "Choose projects to update (Keep empty to update all. Projects list: {{ hostvars['localhost']['projects'] }})"
|
|
private: false
|
|
unsafe: true
|
|
|
|
- name: docker_pull_images
|
|
prompt: "Pull project(s) images?"
|
|
default: false
|
|
private: false
|
|
|
|
tasks:
|
|
- name: Update project(s)
|
|
include_role:
|
|
name: "{{ project }}"
|
|
loop: "{{ (selected_projects | split) | default(projects, true) }}"
|
|
loop_control:
|
|
# Do not use default variable name 'item' to prevent collisions with loops in roles.
|
|
loop_var: project
|
|
when: project in projects
|