Automation with Power

 View Only
  • 1.  Ansible with (Brocade) FOS version 8.2.1c

    Posted Mon September 23, 2024 01:58 PM

    I realize this is more of a storage automation question, but it's part of a series of playbooks I've written that's all about deploying on Power and doing the necessary storage configuration as part of it.  I've successfully used the brocade.fos collection to create zones, aliases, etc. on the new switches running version 9.x of the FOS code. Yet when I try to connect to some older SAN switches, running FOS v8.2.1.c, which shows as supported, I get an error:

    fatal: [localhost]: FAILED! => {"POST_resp_code": 301, "POST_resp_data": "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>301 Moved Permanently</title>\n</head><body>\n<h1>Moved Permanently</h1>\n<p>The document has moved <a href=\"https://********/rest/login\">here</a>.</p>\n</body></html>\n", "POST_resp_reason": "Moved Permanently", "POST_url": "http://********/rest/login", "changed": false, "msg": "POST failed"}

    Module I'm trying to run:
    credential:
    fos_ip_addr: "{{ fos_ip }}"
    fos_user_name: admin
    fos_password: "{{ fos_password }}"
    https: false

    tasks:
    - name: Gather SAN Switch details
    brocade.fos.brocade_facts:
    credential: "{{ credential }}"
    gather_subset:
    - brocade_zoning

    Just wondering if anyone else has run into this and found a solution. 

    Thanks,
    -Mark



    ------------------------------
    Mark Steele
    ------------------------------


  • 2.  RE: Ansible with (Brocade) FOS version 8.2.1c

    Posted Tue September 24, 2024 07:12 AM

    Hi - I see that you have 

    https: false 

    in your credentials. I always use 'true' or 'self' (when self-signed cert). I think with 'false' your going to the insecure page, and it's trying to redirect to the secure (https://)  page but since you had 'false' it's not proceeding. 



    ------------------------------
    Michael Quaranta
    ------------------------------



  • 3.  RE: Ansible with (Brocade) FOS version 8.2.1c

    Posted Tue September 24, 2024 09:44 AM

    Thanks Michael, I figured it out.

    HTTPS isn't working cause of old SSL encryption that wasn't compatible. I need to get these switches configured, so in the meantime, it led me to the solution. HTTP is enabled:

    admin> mgmtapp --show

    REST Interface State: Enabled

    REST Session Count: 3

    REST Throttling Configurations:

       Sample Requests      : 30

       Sample Time (in sec) : 30

       Idle Time (in sec)   : 3

    KeepAlive : Disabled

    KeepAliveTimeout : 15sec

    When I tried to connect to it, I received this:

    $ curl http://10.82.20.230

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

    <html><head>

    <title>301 Moved Permanently</title>

    </head><body>

    <h1>Moved Permanently</h1>

    <p>The document has moved <a href=https://10.82.20.230/>here</a>.</p>

    </body></html>

    I simply deleted the cert and now it works. 



    ------------------------------
    Mark Steele
    ------------------------------