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 panos module to import software or configuration file into firewall #19901
Conversation
category: software | ||
''' | ||
|
||
RETURN = ''' |
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.
doc string doesn't match actual return data
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.
No return so I copied default return string from wakeonlan.py
module.fail_json(msg='pan-python, requests, and requests_toolbelt are required for this module') | ||
|
||
ip_address = module.params["ip_address"] | ||
if not ip_address: |
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 needed
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.
ok
if not ip_address: | ||
module.fail_json(msg="ip_address should be specified") | ||
password = module.params["password"] | ||
if not password: |
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 needed
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.
ok
|
||
file_ = module.params['file'] | ||
url = module.params['url'] | ||
if file_ is None and url is None: |
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.
use required_one_of
kwarg when creating AnsibleModule instead
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.
ok
|
||
try: | ||
import pan.xapi | ||
import requests |
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.
consider using ansible.module_utils.urls
instead of requests
for better compatability
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 did but unfortunately it does not have all the pieces I need. It would also require code change that would make it incompatible with our stand-alone code paths.
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.
can you elaborate on what pieces its missing?
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 could not find MultipartEncoder that we need. It also makes it tightly dependent on ANSIBLE package which makes it hard to share code with stand-alone modules.
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.
@privateip Can you please let me know if you are ok with that?
Thank you for the review. I've incorporated all the changes except request library per comments above. |
Added new module to changelog as requested |
options: | ||
ip_address: | ||
description: | ||
- IP address (or hostname) of PAN-OS device |
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.
All description:
fields should be full sentences, capital letters and full stops.
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.
Thank you for the review. I changed descriptions per 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.
@gundalow Can you please let me know if you are ok with the change?
# The first commit's message is: new module to import software or configuration file onto firewall # This is the 2nd commit message: changes based on the review comments; remove unecessary if statements; change returned value docstring # This is the 3rd commit message: empty checkin to trigger ANSIBLEbot # This is the 4th commit message: added additional exception handling # This is the 5th commit message: - added new module info to the changelog as requested # This is the 6th commit message: removed blank space as tox checks were failing
ready_for_review |
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.
shipit
Peter is happy, so merging |
ISSUE TYPE
COMPONENT NAME
panos_import
ANSIBLE VERSION
SUMMARY
New panos module that allows for import of the configuration files or software releases onto firewall.