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

Support --check mode for pip install --user #71781

Closed
ddimtirov opened this issue Sep 17, 2020 · 3 comments
Closed

Support --check mode for pip install --user #71781

ddimtirov opened this issue Sep 17, 2020 · 3 comments
Labels
affects_2.11 bot_closed feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. module This issue/PR relates to a module. packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@ddimtirov
Copy link

SUMMARY

Currently when we need to specify pip install --user ..., the --user argument goes in as extra argument. This breaks the ansible --check mode, as illustrated byt he following commands:

# OK
ansible -m pip -a "extra_args=--user name=pytz" $HOSTNAME

# CHANGED
ansible -m pip -a "extra_args=--user name=pytz" $HOSTNAME --check

The code responsible for this behaviour is here:

if extra_args or requirements or state == 'latest' or not name:

I would like to request that we either add a separate parameter to request that pip installation is in the user site, or add a further analysis of the content of the extra args (and if it is only --user run the check mode). The latter option would transparently fix all current playbooks which erroneously report changed.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

pip module

ADDITIONAL INFORMATION
- name: Install ansible and dependencies on all hosts
  pip:
    name: ['ansible==2.9.6', 'pytz', 'lxml', 'ansible-lint', 'python-dateutil']
    extra_args: --user

Could become:

- name: Install ansible and dependencies on all hosts
  pip:
    name: ['ansible==2.9.6', 'pytz', 'lxml', 'ansible-lint', 'python-dateutil']
    user_site: on
@ddimtirov ddimtirov changed the title Support --check mode for pip --user Support --check mode for pip --user Sep 17, 2020
@ddimtirov ddimtirov changed the title Support --check mode for pip --user Support --check mode for pip install --user Sep 17, 2020
@ansibot
Copy link
Contributor

ansibot commented Sep 17, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.11 feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 17, 2020
@samdoran
Copy link
Contributor

Currently we just exit with change=True if there are any extra_args in check_mode. To solve this properly, we would need to make the --user a module parameter rather than going into the extra_args and having to special case that string in a sea of args.

@samdoran samdoran added waiting_on_contributor This would be accepted but there are no plans to actively work on it. and removed needs_triage Needs a first human triage before being processed. labels Sep 17, 2020
@ansibot ansibot added the has_pr This issue has an associated PR. label Jan 23, 2021
@ansibot
Copy link
Contributor

ansibot commented Apr 11, 2022

Thank you very much for your submission to Ansible. It means a lot to us that you've taken time to contribute.

Unfortunately, this issue has been open for some time while waiting for a contributor to take it up but there does not seem to have been anyone that did so. So we are going to close this issue to clear up the queues and make it easier for contributors to browse possible implementation targets.

However, we're absolutely always up for discussion. Because this project is very active, we're unlikely to see comments made on closed tickets and we lock them after some time. If you or anyone else has any further questions, please let us know by using any of the communication methods listed in the page below:

In the future, sometimes starting a discussion on the development list prior to proposing or implementing a feature can make getting things included a little easier, but it's not always necessary.

Thank you once again for this and your interest in Ansible!

click here for bot help

@ansibot ansibot added bot_closed and removed waiting_on_contributor This would be accepted but there are no plans to actively work on it. labels Apr 11, 2022
@ansibot ansibot closed this as completed Apr 11, 2022
@ansible ansible locked and limited conversation to collaborators Apr 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.11 bot_closed feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. module This issue/PR relates to a module. packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

3 participants