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 ansible cli options --ask-vault-password and --vault-pass-file #63782

Merged
merged 6 commits into from Dec 19, 2019
Merged

Add ansible cli options --ask-vault-password and --vault-pass-file #63782

merged 6 commits into from Dec 19, 2019

Conversation

ivog74
Copy link
Contributor

@ivog74 ivog74 commented Oct 22, 2019

SUMMARY

The ansible-playbook command provides 2 options to specify a vault password:
--ask-vault-pass
--vault-password-file

One option use 'pass', the other uses 'password'. I propose to use either pass or password for both option. For now I added the following options:
-- ask-vault-password
--vault-pass-file

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

ansible cli

ADDITIONAL INFORMATION

before:

ansible-playbook --ask-vault-pass ....
ansible-playbook --vault-password-file=<filename> ....

after:

ansible-playbook --ask-vault-password ....
ansible-playbook --vault-password-file=<filename> ....

or

ansible-playbook --ask-vault-pass ....
ansible-playbook --vault-pass-file=<filename> ....

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Oct 22, 2019
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Oct 22, 2019
Copy link
Contributor

@samdoran samdoran left a comment

Choose a reason for hiding this comment

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

Rather than adding additional calls to add_argument(), just add additional parameters to the existing add_argument() calls.

Also, please create a changelog fragment and add integration tests to test/integration/targets/vault. See this fragment as an example.

@@ -365,5 +365,9 @@ def add_vault_options(parser):
base_group = parser.add_mutually_exclusive_group()
base_group.add_argument('--ask-vault-pass', default=C.DEFAULT_ASK_VAULT_PASS, dest='ask_vault_pass', action='store_true',
Copy link
Contributor

@samdoran samdoran Oct 22, 2019

Choose a reason for hiding this comment

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

Suggested change
base_group.add_argument('--ask-vault-pass', default=C.DEFAULT_ASK_VAULT_PASS, dest='ask_vault_pass', action='store_true',
base_group.add_argument('--ask-vault-pass', '--ask-vault-password', default=C.DEFAULT_ASK_VAULT_PASS, dest='ask_vault_pass', action='store_true',

lib/ansible/cli/arguments/option_helpers.py Outdated Show resolved Hide resolved
@ansibot ansibot added support:community This issue/PR relates to code supported by the Ansible community. and removed small_patch labels Oct 23, 2019
Copy link
Contributor

@samdoran samdoran left a comment

Choose a reason for hiding this comment

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

Please add integration tests.

@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 Oct 31, 2019
@Akasurde
Copy link
Member

@ivog74 Are you still working on this? Thanks.

@ivog74
Copy link
Contributor Author

ivog74 commented Dec 10, 2019

@ivog74 Are you still working on this? Thanks.

Hi @Akasurde, as far as I'm concerned this PR is finished. Do I still need to add something to the PR ?

@Akasurde
Copy link
Member

Akasurde commented Dec 10, 2019

Hi @Akasurde, as far as I'm concerned this PR is finished. Do I still need to add something to the PR ?

Could you please add integration test for this change here?

@ansibot
Copy link
Contributor

ansibot commented Dec 17, 2019

@ivog74 this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot ansibot added merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Dec 17, 2019
@ansibot ansibot removed the merge_commit This PR contains at least one merge commit. Please resolve! label Dec 18, 2019
@ansibot ansibot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Dec 18, 2019
@samdoran samdoran merged commit bd98905 into ansible:devel Dec 19, 2019
@ansible ansible locked and limited conversation to collaborators Jan 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 feature This issue/PR relates to a feature request. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants