Skip to content
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

Unable to install more than one Airflow Extra Package #50

Closed
1 task done
AdriMarteau opened this issue Jan 30, 2019 · 4 comments
Closed
1 task done

Unable to install more than one Airflow Extra Package #50

AdriMarteau opened this issue Jan 30, 2019 · 4 comments
Assignees

Comments

@AdriMarteau
Copy link

AdriMarteau commented Jan 30, 2019

Prerequisites

Description

When specifying more than 1 airflow extra package, the task Airflow | Installing Airflow Extra Packages fails with error:

(item=['apache-airflow[celery]', 'apache-airflow[postgres]']) => {"changed": false, "item": ["apache-airflow[celery]", "apache-airflow[postgres]"], "msg": "'version' argument is ambiguous when installing multiple package distributions. Please specify version restrictions next to each package in 'name' argument."}

Steps to Reproduce

  1. Set in a vars file
airflow_version: 1.10.0
airflow_extra_packages: [celery,postgres]
  1. Deploy Airflow using the role

Expected behavior: deployment to work

Actual behavior: deployment fails

Reproduces how often: Everytime

Versions

1.7.2

Additional Information

This also generate a warning:

[DEPRECATION WARNING]: Invoking "pip" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying `name: "apache-airflow[{{ item }}]"`, please use `name: '{{
airflow_extra_packages }}'` and remove the loop. This feature will be removed in version 2.11.
@AdriMarteau
Copy link
Author

AdriMarteau commented Jan 31, 2019

Not sure that it was intended but setting (without brackets): airflow_extra_packages: celery,postgres seems to work but the warning remains

@jnogol
Copy link
Collaborator

jnogol commented Jan 31, 2019

Hi @AdriMarteau

Which Ansible version are you using?

@jnogol jnogol self-assigned this Jan 31, 2019
@AdriMarteau
Copy link
Author

I am on ansible 2.7.6

AdriMarteau added a commit to AdriMarteau/airflow-role that referenced this issue May 22, 2019
@jnogol jnogol mentioned this issue May 22, 2019
@jnogol
Copy link
Collaborator

jnogol commented Jun 18, 2019

Thing is more delicate than I expected. Technically, all members of a list are lines beginning at the same indentation level starting with a "- " (a dash and a space): so we will specify the format in the defaults file and make a comma-separated list for Ansible versions greater than 2.7:

"apache-airflow[{{ airflow_extra_packages | join(', ') }}]"

This way, the role will have a backwards compatibility and will be able to use with Ansible 2.11

jnogol pushed a commit that referenced this issue Jun 18, 2019
jnogol pushed a commit that referenced this issue Jun 18, 2019
This was referenced Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants