-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
New modules and updated HTTP API plugin for FTD devices #44578
New modules and updated HTTP API plugin for FTD devices #44578
Conversation
@annikulin this PR contains more than one new module. Please submit only one new module per pull request. For a detailed explanation, please read the grouped modules documentation |
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
|
lib/ansible/plugins/httpapi/ftd.py
Outdated
return False | ||
self.login(self.connection.get_option('remote_user'), self.connection.get_option('password')) | ||
retry_request = True | ||
return retry_request |
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.
This can be converted to return True. No need of new variable retry_request
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.
Thanks, done.
# plugin | ||
self.refresh_token = False | ||
self.access_token = False | ||
display.vvvv("logged out successfully") |
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.
not sure why logout is removed ? Don't we want to revoke token once connection is terminated ?
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.
logout
method still there. It was just moved closer to the login
method.
display.vvvv("logged out successfully") | ||
@staticmethod | ||
def _get_api_token_path(): | ||
return os.environ.get(API_TOKEN_PATH_ENV_VAR, DEFAULT_API_TOKEN_PATH) |
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.
Please change these vars to ansible Host vars rather OS env vars.
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.
Good point. Can you please help how to get Ansible host variable?
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.
@annikulin it needed more work than I initially thought to get httpapi plugin host var working. Probably we can commit this code as is and I will commit a followup PR to make it configurable using ansible host vars
return True | ||
|
||
|
||
def equal_objects(d1, d2): |
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.
I think this might now work when there is dict of dict in response? It might break idempotency in those cases.
I think you need to call it recursively when there is dict of dict or dict of list of dict.
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.
Thanks, updated.
@@ -0,0 +1,159 @@ | |||
import re |
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.
Please add copyright in all the files.
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.
Thanks, added.
@annikulin this PR contains the following merge commits: Please rebase your branch to remove these commits. |
SUMMARY
ftd_configuration
module that manages configuration on FTD devices;ftd_file_upload
module that provides functionality to upload files to FTD devices;ftd_file_download
module that provides functionality to download files from FTD devices;ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION