Forum Discussion

kumar10's avatar
kumar10
Icon for Nimbostratus rankNimbostratus
9 months ago
Solved

Automate F5OS license activation using ansible

Hello, working to automate the process of licensing the F5OS platform (r-series) using ansible but with the version we have in our production we cannot use F5OS ansible galaxy modules so we are us...
  • kumar10's avatar
    9 months ago

    Thank you for your replies. I was able to achieve this using ansible shell module. below task gets the activated dossier from "https://activate.f5.com/license/license.do" via proxy "http://proxyurl.com:80" and saves to local path.


    - name: set license file path fact
      set_fact:
        license_file: "/localpath/{{ inventory_hostname }}_license.txt"

    - name: Activate License from F5 and extract license block
      shell: |
        curl -x http://proxyurl.com:80 -X POST \
          -F "dossier={{ dossier }}" -F "submit=Next" -s -k \
          https://activate.f5.com/license/license.do | \
        sed -n '/<textarea[^>]*name="license"[^>]*>/,/<\/textarea>/p' | \
        sed '1d;$d' | \
        sed 's/&quot;/"/g' > {{ license_file }}
      register: f5os_license
      delegate_to: localhost