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

Do I have to install requirements.txt by myself after galaxy install? #167

Closed
ggicci opened this issue Sep 29, 2020 · 3 comments · Fixed by #209
Closed

Do I have to install requirements.txt by myself after galaxy install? #167

ggicci opened this issue Sep 29, 2020 · 3 comments · Fixed by #209

Comments

@ggicci
Copy link

ggicci commented Sep 29, 2020

SUMMARY

After installing by using galaxy CLI: ansible-galaxy collection install amazon.aws. I got error as below when I ran ansible-inventory --graph:

ERROR! The ec2 dynamic inventory plugin requires boto3 and botocore.

I saw the required packages hadn't been installed in my .venv. So do I have to install the required packages by myself? Like calling pip install -r collections/ansible_collections/amazon/aws/requirements.txt?

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible 2.10.1
  config file = /home/ggicci/.ansible.cfg
  configured module search path = ['/home/ggicci/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ggicci/.vault/app/ansible/.venv/lib/python3.8/site-packages/ansible
  executable location = /home/ggicci/.local/bin/ansible
  python version = 3.8.0 (default, Dec  9 2019, 13:33:00) [GCC 7.4.0]
CONFIGURATION
ANSIBLE_SSH_CONTROL_PATH(/home/ggicci/.ansible.cfg) = %(directory)s/%%C
ANSIBLE_SSH_CONTROL_PATH_DIR(/home/ggicci/.ansible.cfg) = /tmp/ansible/cp
ANSIBLE_SSH_RETRIES(/home/ggicci/.ansible.cfg) = 3
COLLECTIONS_PATHS(/home/ggicci/.ansible.cfg) = ['/home/ggicci/.ansible/collections']
DEFAULT_ASK_PASS(/home/ggicci/.ansible.cfg) = False
DEFAULT_EXECUTABLE(/home/ggicci/.ansible.cfg) = /bin/bash
DEFAULT_GATHERING(/home/ggicci/.ansible.cfg) = implicit
DEFAULT_GATHER_SUBSET(/home/ggicci/.ansible.cfg) = ['all']
DEFAULT_GATHER_TIMEOUT(/home/ggicci/.ansible.cfg) = 10
DEFAULT_HOST_LIST(/home/ggicci/.ansible.cfg) = ['/home/ggicci/.ansible/inventories']
DEFAULT_LOCAL_TMP(/home/ggicci/.ansible.cfg) = /tmp/ansible/ansible-local-28968sikgxydh
DEFAULT_MODULE_NAME(/home/ggicci/.ansible.cfg) = command
DEFAULT_MODULE_UTILS_PATH(/home/ggicci/.ansible.cfg) = ['/home/ggicci/.ansible/plugins/module_utils', '/usr/share/ansible/plugins/module_utils']
DEFAULT_REMOTE_USER(/home/ggicci/.ansible.cfg) = root
DEFAULT_ROLES_PATH(/home/ggicci/.ansible.cfg) = ['/home/ggicci/.ansible/roles', '/usr/share/ansible/roles', '/etc/ansible/roles']
DEFAULT_SCP_IF_SSH(/home/ggicci/.ansible.cfg) = True
DEFAULT_SSH_TRANSFER_METHOD(/home/ggicci/.ansible.cfg) = scp
DEFAULT_TIMEOUT(/home/ggicci/.ansible.cfg) = 10
DEFAULT_TRANSPORT(/home/ggicci/.ansible.cfg) = smart
ERROR_ON_MISSING_HANDLER(/home/ggicci/.ansible.cfg) = True
HOST_KEY_CHECKING(/home/ggicci/.ansible.cfg) = True
INVENTORY_ENABLED(/home/ggicci/.ansible.cfg) = ['auto', 'yaml', 'script', 'gcp_compute', 'aws_ec2']
PERSISTENT_COMMAND_TIMEOUT(/home/ggicci/.ansible.cfg) = 30
PERSISTENT_CONNECT_TIMEOUT(/home/ggicci/.ansible.cfg) = 60
OS / ENVIRONMENT

Ubuntu 18.04.5

STEPS TO REPRODUCE
mkdir -p /tmp/ansible-venv && cd $_
source bin/activate
pip install "ansible==2.10.0"
ansible --version # print 2.10.1 (confused here, I thought I installed 2.10.0)
ansible-galaxy collection install amazon.aws
ansible-inventory --graph

Since I have xxx.aws_ec2.yml under my inventories folder, the last command ansible-inventory --graph will fail.

EXPECTED RESULTS

The command ansible-inventory --graph should work.

ACTUAL RESULTS
ansible-inventory 2.10.1
  config file = /home/ggicci/.ansible.cfg
  configured module search path = ['/home/ggicci/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ggicci/.vault/app/ansible/.venv/lib/python3.8/site-packages/ansible
  executable location = /home/ggicci/.local/bin/ansible-inventory
  python version = 3.8.0 (default, Dec  9 2019, 13:33:00) [GCC 7.4.0]
Using /home/ggicci/.ansible.cfg as config file
setting up inventory plugins
redirecting (type: inventory) ansible.builtin.gcp_compute to google.cloud.gcp_compute
Loading collection google.cloud from /home/ggicci/.vault/app/ansible/.venv/lib/python3.8/site-packages/ansible_collections/google/cloud
redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2
Loading collection amazon.aws from /home/ggicci/.ansible/collections/ansible_collections/amazon/aws
ERROR! The ec2 dynamic inventory plugin requires boto3 and botocore.
@ggicci ggicci changed the title Do I have to install requirements.txt by my self after galaxy install? Do I have to install requirements.txt by myself after galaxy install? Sep 29, 2020
@Akasurde
Copy link
Member

@ggicci ansible-galaxy command only installs collection and not the required libraries. You will need to install the required libraries using the pip command.

@ggicci
Copy link
Author

ggicci commented Sep 29, 2020

@ggicci ansible-galaxy command only installs collection and not the required libraries. You will need to install the required libraries using the pip command.

I see. Thanks for the reply. BTW, could you explain why not automatically installing the dependencies required by the collections? Will it bring any side effects?

And further more, do we have an option to install them when installing the collections? e.g. ansible-galaxy collection install xxx --with-dependencies. It will be great helpful, IMO.

@Akasurde
Copy link
Member

Basically, dependencies are maintained by the third party. Installing them using ansible-galaxy command makes the user think that they are supported and maintained by collection/Ansible as well (which is not true).

Ansible never installs dependencies for the user, since every user's environment might differ.

You might want to take a look at this issue ansible/ansible#69174 for further information.

@jillr jillr closed this as completed in #209 Dec 1, 2020
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 16, 2022
ansible/ansible/pull/69993 changed copy's mode behaviour. Lambda tests
which copy files to '{{ outpur_dir }}' before zipping are now being
unzipped by Lambda with incorrect permissions, causing test failures.

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1b1dbee
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 16, 2022
…copying lambdas) (ansible-collections#168)

lambda_policy should now be stable
apply same change to s3_bucket_notification

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@0bad2c0
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 16, 2022
ansible/ansible/pull/69993 changed copy's mode behaviour. Lambda tests
which copy files to '{{ outpur_dir }}' before zipping are now being
unzipped by Lambda with incorrect permissions, causing test failures.

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1b1dbee
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 16, 2022
…copying lambdas) (ansible-collections#168)

lambda_policy should now be stable
apply same change to s3_bucket_notification

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@0bad2c0
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 21, 2022
ansible/ansible/pull/69993 changed copy's mode behaviour. Lambda tests
which copy files to '{{ outpur_dir }}' before zipping are now being
unzipped by Lambda with incorrect permissions, causing test failures.

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1b1dbee
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 21, 2022
…copying lambdas) (ansible-collections#168)

lambda_policy should now be stable
apply same change to s3_bucket_notification

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@0bad2c0
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 21, 2022
ansible/ansible/pull/69993 changed copy's mode behaviour. Lambda tests
which copy files to '{{ outpur_dir }}' before zipping are now being
unzipped by Lambda with incorrect permissions, causing test failures.

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1b1dbee
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 21, 2022
…copying lambdas) (ansible-collections#168)

lambda_policy should now be stable
apply same change to s3_bucket_notification

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@0bad2c0
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 21, 2022
ansible/ansible/pull/69993 changed copy's mode behaviour. Lambda tests
which copy files to '{{ outpur_dir }}' before zipping are now being
unzipped by Lambda with incorrect permissions, causing test failures.

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1b1dbee
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this issue Sep 21, 2022
…copying lambdas) (ansible-collections#168)

lambda_policy should now be stable
apply same change to s3_bucket_notification

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@0bad2c0
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
ansible/ansible/pull/69993 changed copy's mode behaviour. Lambda tests
which copy files to '{{ outpur_dir }}' before zipping are now being
unzipped by Lambda with incorrect permissions, causing test failures.
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
…copying lambdas) (ansible-collections#168)

lambda_policy should now be stable
apply same change to s3_bucket_notification
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

Successfully merging a pull request may close this issue.

2 participants