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

Add new session parameter to win_psexec #44263

Merged
merged 3 commits into from
Aug 28, 2018

Conversation

Xyon
Copy link
Contributor

@Xyon Xyon commented Aug 16, 2018

SUMMARY

Allows users to specify the Windows session they would like psexec to interact with, per the documentation for psexec around the -i flag.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

win_psexec

ANSIBLE VERSION
ansible 2.7.0.dev0
  config file = None
  configured module search path = ['/home/xyon/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib64/python3.6/site-packages/ansible
  executable location = /usr/lib/python-exec/python3.6/ansible
  python version = 3.6.5 (default, Jul 24 2018, 10:14:42) [GCC 7.3.0]

ADDITIONAL INFORMATION
Prior to this change, you could only specify "interactive: yes", which would just pass the -i flag to psexec.exe. For many purposes this is sufficient, but on certain boxes this causes the command to attach to the services console session rather than the Desktop (on session 1) as might be expected.

If provided, the value of session is passed to the -i flag, causing psexec to attempt to attach there instead. This proves useful in environments such as Azure, on a Windows 10 machine, when attempting to spawn processes on the desktop.

If no value for session is provided, the behaviour is as before the change.

@ansibot
Copy link
Contributor

ansibot commented Aug 16, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 community_review In order to be merged, this PR must follow the community review workflow. 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. python3 support:community This issue/PR relates to code supported by the Ansible community. windows Windows community labels Aug 16, 2018
@ansibot

This comment has been minimized.

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Aug 16, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Aug 16, 2018
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Aug 16, 2018
@@ -65,6 +65,11 @@
- Run the program so that it interacts with the desktop on the remote system.
type: bool
default: 'no'
session:
description:
- In conjunction with interactive, specify a session for psexec to attach to. Has no effect if interactive is 'no'.
Copy link
Contributor

@dagwieers dagwieers Aug 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We prefer if the first entry of the description is the summary of what the parameter is for.
Subsequent entries can clarify how it is used. So I would do:

  session:
    description:
    - Specifies the session ID to use.
    - This parameter works in conjunction with parameter C(interactive).
    - It has no effect when C(interactive) is set to C(no).
    type: int
    version_added: '2.7'

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Aug 16, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 24, 2018
@jborean93
Copy link
Contributor

Have added the changelog fragment and edited the doc to match @dagwieers recommendations. Thanks @Xyon for the PR.

@jborean93 jborean93 dismissed dagwieers’s stale review August 28, 2018 23:42

I've changed the code myself

@jborean93 jborean93 merged commit 03261b3 into ansible:devel Aug 28, 2018
@Xyon Xyon deleted the feature/win-psexec-session-selection branch October 23, 2018 16:16
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. python3 stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. windows Windows community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants