F5 UCS Fetch module

21 views
Skip to first unread message

Barry Obie

unread,
May 27, 2019, 11:30:30 PM5/27/19
to Ansible Project
I'm getting an error on just a couple of F5 appliances when I'm running the bigip_ucs_fetch module. This works fine on four other appliances, but fails on two with the below error.
The UCS file is created on the appliance, but never shows up in the share and eventually I get the error. 

"msg": "502 Unexpected Error: Bad Gateway for uri: https://10.10.10.10:443/mgmt/tm/sys/ucs/\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<head>\\n<title>Bad Gateway!</title>\\n<link rev=\"made\" href=\"mailto:sup...@f5.com\" />\\n<style type=\"text/css\"><!--/*--><![CDATA[/*><!--*/ \\n    body { color: #000000; background-color: #FFFFFF; }\\n    a:link { color: #0000CC; }\\n    p, address {margin-left: 3em;}\\n    span {font-size: smaller;}\\n/*]]>*/--></style>\\n<style type=\"text/css\"><!--/*--><![CDATA[/*><!--*/ \\n* { width: 400px; font-size: 100%; font-style: normal; }\\nhtml { text-align: center; }\\nbody { background: #ffffff; text-align: left; font-family: sans-serif; font-size: 70%; color: #333333; }\\n\\na,span { width: auto; } \\nh1,h2,h3 { margin: 20px 0px 20px 0px; font-weight: bold; }\\n\\nh1 { padding: 5px; border: 1px solid #999999; background: #eeeeee; color: #000000; font-size: 125%;  }\\nhr { height: 1px; border: none; border-top: 1px solid #999999; }\\nimg { border: 0px; }\\np { width: 350px; margin: 15px 25px 15px 25px; line-height: 135%; }\\n/*]]>*/--></style>\\n\\n</head>\\n\\n<body>\\n<h1>Bad Gateway!</h1>\\n<p>\\n\\n\\n    The proxy server received an invalid\\n    response from an upstream server.\\n\\n  \\n    </p>\\n<p>\\n\\n    The proxy server could not handle the request <em><a href=\"/mgmt/tm/sys/ucs/\">POST&nbsp;/mgmt/tm/sys/ucs/</a></em>.<p>\\nReason: <strong>Error reading from remote server</strong></p>\\n  \\n    \\n</p>\\n\\n<h2>Error 502</h2>\\n<address>\\n  <a href=\"/\">10.10.10.10</a><br />\\n  \\n  <span>Mon May 27 20:24:43 2019<br />\\n  </span>\\n</address>\\n</body>\\n</html>\\n\\n'"

---playbook.yml
---
- name: Run UCS Archive on F5 BIG-IPs
  hosts: all
  connection: local
  gather_facts: False

  vars:
    f5Provider:
      server: "{{ mgmtAddr }}"
      server_port: 443
      user: "{{ f5_username }}"
      password: "{{ f5_password }}"
      validate_certs: no
      transport: rest

  tasks:

    - name: Set archive name postfix date/time
      local_action: command date +%Y%m%d-%H%M%Z
      changed_when: false
      register: date
      delegate_to: localhost
      
    - name: Set filename
      set_fact: 
        filename: "{{ inventory_hostname }}-{{ date['stdout'] }}.ucs"

    - name: Fetch UCS archive
      bigip_ucs_fetch:
        src: "{{ filename }}"
        dest: "/share/{{ inventory_hostname_short }}/{{ filename }}"
        provider: "{{f5Provider}}"
      delegate_to: localhost

    - name: Wipe UCS archive
      bigip_ucs: 
        ucs: "{{ filename }}"
        state: absent
        provider: "{{f5Provider}}"
      delegate_to: localhost



Thanks for any help.

Tim

unread,
May 27, 2019, 11:55:15 PM5/27/19
to ansible...@googlegroups.com
In the past this would usually occur when the restjavad daemon had
crashed on the box. Does this happen with other modules? Can you run
`bigstart restart restjavad` and try again? The other thing I can
think of is that in the process of taking the UCS file, the restjavad
daemon is restarting or crashing and this is resulting in an error
being bubbled up to the apache frontend and sent back to the module.
In this case the module should probably handle *some* of these cases,
but I wouldn't know without further looking.

Suggest that if the aforementioned does not help that you consider
opening an issue on the F5Networks/f5-ansible github repo

https://github.com/F5Networks/f5-ansible

My former colleague Wojciech, who maintains these modules today, may
be able to assist further.

-tim
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fd88ade6-434c-4abf-80a2-edb4503bedf4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Barry Obie

unread,
May 28, 2019, 4:15:58 PM5/28/19
to Ansible Project
I tried bigip_device_facts and it was successful. I opened a GitHub issue, but it was closed as likely an issue with the F5. So I have a ticket with F5 support. I saw some timeout errors in httpd and restjavad logs. 

Thanks,
Barry
Reply all
Reply to author
Forward
0 new messages