New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import_role with extra-vars option #69097
Comments
I'm not positive if there is a resolution to this. It may not be feasible to consult extra vars at this phase of the playbook run. I'd recommend that you switch to |
Tags are not taken into account if I use |
Look into using |
I can't succeed to make it works my ---
- name: Create or update a deployment
hosts: all
vars:
- deployment_template_path: "{{ deployment_path }}/deployment_template"
- current_deployment_path: "{{ deployment_path }}/{{ deployment_name }}"
tasks:
- name: include deploy role with its overriden variables
include_role:
name: deploy
vars_from: "{{ deployment_name }}"
apply:
tags:
- dockercompose and my ---
- fail:
msg: The variable 'locale' is not set
when: locale is none
- debug:
msg: The variable 'sftp_password' is not set
when: sftp_password is none
- include: stop-inotify.yml
- include: files.yml
- include: common_database.yml
- include: network.yml
- include: sftp.yml
- include_tasks:
file: docker.yml
apply:
tags:
- dockercompose
tags:
- dockercompose
- include: stop-inotify.yml
- include: backend.yml
- include: db.yml
- include: module_seed.yml
- include: office.yml
- include: start-inotify.yml
- include: cron.yml My tasks in docker.yml are not executed |
You would need to use something like:
|
But if I set
|
No, that is what I think we've confused something here. You stated:
Which I assumed meant you wanted to use
Then the |
I was thinking of the Thank you very much, it is now working and I learned a few things. I let the issue open for the original issue. Regards, |
+1 user with this problem; Have changed "include_role" on "import_role" and nothing good happened. Created my own issue here - #69916 |
SUMMARY
variable from extra-vars is not set while import_role is parsed
ISSUE TYPE
COMPONENT NAME
import_role
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Debian 10 hosted on GCP compute engine
STEPS TO REPRODUCE
EXPECTED RESULTS
run tasks specified by the tags
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: