31 lines
857 B
YAML
31 lines
857 B
YAML
|
- name: Include variables files
|
||
|
hosts: localhost
|
||
|
roles:
|
||
|
- include-vars
|
||
|
|
||
|
- name: Setup & update project(s)
|
||
|
hosts: localhost
|
||
|
vars:
|
||
|
run_setup: true
|
||
|
run_update: true
|
||
|
vars_prompt:
|
||
|
- name: selected_projects
|
||
|
prompt: "Choose projects to setup & update (Keep empty to select 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: Setup & 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
|