F5Networks / f5-ansible

Imperative Ansible modules for F5 BIG-IP products
GNU General Public License v3.0
376 stars 229 forks source link

bigip_provision fails; when we are setting multiple modules in 13.x release of f5 #669

Closed vs926p closed 6 years ago

vs926p commented 6 years ago
ISSUE TYPE
COMPONENT NAME

bigip_provision

ANSIBLE VERSION

2.5

PYTHON VERSION
BIGIP VERSION

13.1

LIBRARY VERSIONS
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

When I run sys prov modules to set afm and ltm levels it fails for the second one.

STEPS TO REPRODUCE
---
- name: Set AFM Provision to Nominal
  bigip_provision:
    level: "nominal"
    module: "afm"
    state: "present"
    server: "{{ ansible_host }}"
    user: "{{ username }}"
    password: "{{ password }}"
    validate_certs: "no"
  delegate_to: localhost

---
- name: Set LTM Provision to None
  bigip_provision:
    module: "ltm"
    state: "absent"
    server: "{{ ansible_host }}"
    user: "{{ username }}"
    password: "{{ password }}"
    validate_certs: "no"
  delegate_to: localhost

Then the second play above fails in 13.1 release. It works fine in 12.x release.

EXPECTED RESULTS

It should work fine as it should check status before it proceeds with next play. When I add a pause in first play it works fine.

ACTUAL RESULTS

Failed.

Error Message:

tmptool@VMUbuntu:/home/tmptool/ansible/Nimbus_ansible_2018$ ansible-playbook base.yml --ask-vault-pass --tag provision Vault password:

PLAY [single] ***

TASK [f5base : Set AFM Provision to Nominal] **** changed: [bigip1 -> localhost]

TASK [f5base : Set LTM Provision to None] *** fatal: [bigip1 -> localhost]: FAILED! => {"changed": false, "failed": true, "msg": "503 Unexpected Error: Service Temporarily Unavailable for uri: https://192.168.50.15:443/mgmt/tm/sys/provision/ltm/\nText: u'<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n \n BIG-IP\xae - Configuration Utility restarting...\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/xui/common/css/tomcat_unavailable.css\">\n <link rel=\"Shortcut Icon\" type=\"image/x-icon\" href=\"/xui/common/images/favicon.ico\">\n <script type=\"text/javascript\" src=\"/xui/common/scripts/jquery_1.3.2.js\">\n <script language=\"Javascript\">\n if (window.location != window.top.location) {\n var url = getUrlToPing();\n window.top.location.replace(url);\n }\n\n var timerID = 0;\n var tStart = null;\n\n $(document).ready(function() {\n $(\'#timestamp\').text(Date().split(\'GMT\')[0]);\n var ipOrHostname = window.location.hostname;\n var isIpv6 = ((ipOrHostname.indexOf(\':\') > -1) && (ipOrHostname.indexOf(\'.\') === -1));\n var isIpv4 = function(ipOrHostname) {\n var segments = ipOrHostname.split(\'.\');\n if(segments.length === 4) {\n return segments.every(function(segment) {\n return ((/^[0-9]+$/.test(segment)) && (segment < 256));\n });\n }\n return false;\n }\n if (isIpv6 || isIpv4(ipOrHostname)) {\n $(\'#hostname-label\').remove();\n $(\'#hostname\').remove();\n $(\'#ip\').text(ipOrHostname);\n } else {\n $(\'#hostname\').text(ipOrHostname);\n $(\'#ip-label\').remove();\n $(\'#ip\').remove();\n }\n startTimer();\n setTimeout(pingDevice, 1000);\n });\n\n function startTimer() {\n tStart = new Date();\n $(\'#timer\').text(\'0:00\');\n timerID = setTimeout(\"updateTimer()\", 1000);\n }\n\n function updateTimer() {\n var tDate = new Date();\n var tDiff = tDate.getTime() - tStart.getTime();\n tDate.setTime(tDiff);\n var separator = tDate.getSeconds() < 10 ? \':0\' : \':\';\n $(\'#timer\').text(tDate.getMinutes() + separator + tDate.getSeconds());\n timerID = setTimeout(\"updateTimer()\", 1000);\n }\n\n function pingDevice() {\n var url = getUrlToPing();\n var pingTimer = 3000;\n var responseObj = $.ajax({\n url: url,\n timeout: 2000,\n cache: false,\n beforeSend: function(requestObj) {\n requestObj.setRequestHeader(\"F5-Automated-Request\", \"true\");\n },\n // Device is online\n success: function(response) {\n $(\'#status1\').removeClass(\'loadingicon\').addClass(\'greencheckicon\');\n $(\'#status2\').show();\n window.location.replace(url);\n },\n // Waiting to establish a connection\n error: function(response) {\n setTimeout(pingDevice,pingTimer);\n }\n });\n }\n\n function getUrlToPing() {\n if (window.location.toString().indexOf(\'/tmui/Control/form\') == -1) {\n return window.location.toString();\n }\n else if (document.referrer) {\n return document.referrer;\n }\n else {\n if (window.parent && window.parent.Xui) {\n return window.parent.path_pingUrl;\n }\n else {\n return \'/tmui/tmui/overview/welcome/introduction.jsp\';\n }\n }\n }\n \n \n \n <div id=\"wrapper\">\n <div id=\"window\">\n <div id=\"banner\">\n <div id=\"logo\">\n <img src=\"/xui/common/images/logo_f5.png\" alt=\"F5 Networks Logo\"/>\n

\n

BIG-IP Configuration Utility

\n

F5 Networks, Inc

\n
\n <div id=\"sidebar\">\n <div id=\"deviceinfo\">\n <label id=\"hostname-label\">Hostname\n <p id=\"hostname\">

\n <label id=\"ip-label\">IP Address\n <p id=\"ip\">

\n \n \n <div id=\"contentframe\">\n

Please wait while the Configuration Utility starts.

\n <p id=\"timestamp\">

\n

Elapsed Time: <span id=\"timer\">

\n <p id=\"status1\" class=\"loadingicon\">\n <span class=\"goodtext\">Starting web server
\n <span class=\"bold\">Please do not reboot your device. The device is starting services required for the communication with the configuration utility.
\n This process takes approximately 1-2 minutes.\n

\n <p id=\"status2\" class=\"greencheckicon\" style=\"display: none;\">\n <span class=\"goodtext\">Startup complete
\n The configuration utility is ready for use. Input your credentials on the left and click the \"Log in\" button to continue.\n

\n\n \n <div style=\"display: none;\">\n <img src=\"/xui/common/images/icon_greencheck.gif\">\n <img src=\"/xui/common/images/icon_loading.gif\">\n \n \n \n \n \n\n'"}

PLAY RECAP ** bigip1 : ok=2 changed=1 unreachable=0 failed=1

caphrim007 commented 6 years ago

@vs926p can you post the error you're receiving?

vs926p commented 6 years ago

Added the error message in the Issue itself.

caphrim007 commented 6 years ago

@vs926p thanks. that's the same error I was receiving. I believe I have this fixed now locally.

vs926p commented 6 years ago

Ok cool. Thanks.

Can you please let me know once the provision.py in library is updated and I can retest and confirm it.

caphrim007 commented 6 years ago

@vs926p I've pushed the necessary changes. have a go

vs926p commented 6 years ago

Hi Tim,

I tested this using the new module and it works fine without pause now.

Thanks.

​​​​​ Thanks and Regards,

Vivek Shah

From: Tim Rupp [mailto:notifications@github.com] Sent: Monday, March 19, 2018 3:44 PM To: F5Networks/f5-ansible f5-ansible@noreply.github.com Cc: SHAH, VIVEK vs926p@att.com; Mention mention@noreply.github.com Subject: Re: [F5Networks/f5-ansible] bigip_provision fails; when we are setting multiple modules in 13.x release of f5 (#669)

@vs926phttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_vs926p&d=DwMCaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=_GSwOKiA8DX4lv8wd-zBcw&m=ATYN7NMGc_UKpB7UBpdoNnLZqY-LDD_cHkimpGnfo_A&s=jmjHbmvjb3-Eg2-o_La1geQLghJt23DIlg8CBXk7R4c&e= I've pushed the necessary changes. have a go

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_F5Networks_f5-2Dansible_issues_669-23issuecomment-2D374344893&d=DwMCaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=_GSwOKiA8DX4lv8wd-zBcw&m=ATYN7NMGc_UKpB7UBpdoNnLZqY-LDD_cHkimpGnfo_A&s=dmG_YlgXHb23gTMpg_Fnts1hF-2dJD-P6hqW97-8S0Y&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_Ahcnz3wUsDfe3EbKOtQgtw7OQPD75YY-5Fks5tgAqFgaJpZM4Ss4gk&d=DwMCaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=_GSwOKiA8DX4lv8wd-zBcw&m=ATYN7NMGc_UKpB7UBpdoNnLZqY-LDD_cHkimpGnfo_A&s=e212QlF7TUeGvuTemUvm41QFYTFqHNO3E8EprFrKOLg&e=.