-
Notifications
You must be signed in to change notification settings - Fork 33
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 vault_password_file param to PlaybookRunner #129
Add vault_password_file param to PlaybookRunner #129
Conversation
Codecov Report
@@ Coverage Diff @@
## master #129 +/- ##
==========================================
+ Coverage 79.78% 79.82% +0.04%
==========================================
Files 19 19
Lines 1865 1869 +4
==========================================
+ Hits 1488 1492 +4
Misses 377 377
Continue to review full report at Codecov.
|
self._upload_file(vault_password_file) | ||
) | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on line 188, I guess that you will have to upload that key file to host server, in case upload_playbook=True
EDIT:
Actually other way around. You have to pass local path to key in case upload_paybook=False
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you always have to pass local paths to both vault_password_file
and to vars_files
. No matter the value of upload_playbook
. Let me update the docstring so this is clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.upload_file
returns path on remote host. and in case you pass upload_playbook=False
you should pass "--vault-password-file={}".format(vault_password_file)
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you do have a point, but exactly the same also goes for vars_files
. When I originally wrote this class and method, I never intended for user to upload any of those files manually. The parameters upload_playbook
was implemented by @santos1709 and back then it was agreed that we wouldn't accommodate vars_files
to it. However, it we want vars_files
and vault_password_file
to react on the value of upload_playbook
, I think this requires bigger and more careful change. If that's the case, I suggest tracking it in a new issue/ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, please open an issue. and we will merge this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracked in #130 . I'll also create a ticket in our Jira board
Adding
vault_password_file
parameter toPlaybookRunner.run()
method. This is needed if we want to use Ansible vault protected variables files.