Skip to content
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

"URI path /mgmt/tm/sys not registered. Please verify URI is supported and wait for /available suffix to be responsive." #2

Open
rmarcandier13 opened this issue Apr 25, 2020 · 1 comment

Comments

@rmarcandier13
Copy link

rmarcandier13 commented Apr 25, 2020

Hello,

I am trying to perform the following playbook:

--- # Deploy a BIG-IP in AWS

- name: Deploy BIG-IP
  hosts: localhost
  gather_facts: false
  vars_files:
    - secrets.yaml

  tasks:
  # Get My IP Address
  - name: Get public IP address
    uri: 
      url: "http://checkip.amazonaws.com"
      return_content: yes
    register: myip

  # Deploy BIG-IP in AWS
  - name: Deploy a BIG-IP in AWS via CFT
    register: deploy_output
    cloudformation:
      stack_name: "{{ stack_name }}"
      state: present
      region: "{{ region }}"
      template_url: "{{ template_url }}"
      template_parameters:
        Vpc: "{{ vpc }}"
        subnet1Az1: "{{ subnet1Az1 }}"
        imageName: "{{ imageName }}"
        instanceType: "{{ instanceType }}"
        sshKey: "{{ sshKey }}"
        restrictedSrcAddress: "{{ myip.content | replace('\n', '') }}/32"
        restrictedSrcAddressApp: "{{ myip.content | replace('\n', '') }}/32"

  # Wait for BIG-IP to be ready
  - name: Wait for BIG-IP to be ready
    wait_for:
      host: "{{ deploy_output.stack_outputs.Bigip1subnet1Az1SelfEipAddress }}"
      port: "{{ deploy_output.stack_outputs.Bigip1Url | urlsplit('port')}}"
      state: present

  # Change the BIG-IP admin password
  - name: Change BIG-IP admin password
    bigip_command:
      provider:
        server: "{{ deploy_output.stack_outputs.Bigip1subnet1Az1SelfEipAddress }}"
        ssh_keyfile: "{{ ssh_keyfile }}"
        transport: cli
        user: "{{ f5_user }}"
      commands: modify auth user {{ f5_user }} password {{ f5_password }}

  # Install Declarative Onboarding RPM
  # NOTE: rpm binary must be located on host running playbook
  - name: Retrieve DO Install Version
    find:
      paths: "{{ playbook_dir }}/files"
      patterns: "f5-decl*.rpm"
    register: dorpm

  - name: Install DO
    bigip_lx_package:
      package: "{{ dorpm.files[0].path }}"
      provider:
        server: "{{ deploy_output.stack_outputs.Bigip1subnet1Az1SelfEipAddress }}"
        server_port: "{{ deploy_output.stack_outputs.Bigip1Url | urlsplit('port')}}"
        transport: rest
        user: "{{ f5_user }}"
        password: "{{ f5_password }}"
        validate_certs: no
  
  # Push Declarative Onboarding declaration to BIG-IP
  - name: Push DO declaration to BIG-IP
    uri:
      url: "{{ deploy_output.stack_outputs.Bigip1Url }}/mgmt/shared/declarative-onboarding"
      method: POST
      user: "{{ f5_user }}"
      password: "{{ f5_password }}"
      body: "{{ lookup('file', 'files/single_nic_do.json') }}"
      status_code: 202
      timeout: 300
      body_format: json
      validate_certs: no

  - debug:
      var: deploy_output.stack_outputs

I created the directory /files on my local laptop:

(myansible) ➜ Automation_Webinar git:(master) ll
total 64
-rw-r--r-- 1 rengonca staff 105B 24 Apr 14:28 ansible.cfg
drwxr-xr-x 3 rengonca staff 96B 24 Apr 14:28 app_inputs
-rw-r--r-- 1 rengonca staff 506B 24 Apr 14:28 create_app.yaml
-rw-r--r-- 1 rengonca staff 222B 24 Apr 14:28 delete_bigip.yaml
-rw-r--r-- 1 rengonca staff 2.6K 25 Apr 00:47 deploy_bigip.yaml
drwxr-xr-x 3 rengonca staff 96B 24 Apr 22:26 files
drwxr-xr-x 3 rengonca staff 96B 25 Apr 00:03 group_vars
-rw-r--r-- 1 rengonca staff 172B 24 Apr 16:11 hosts
drwxr-xr-x 8 rengonca staff 256B 24 Apr 16:20 myansible
-rw-r--r-- 1 rengonca staff 1.0K 24 Apr 14:28 node_mgmt.yaml
-rw-r--r-- 1 rengonca staff 1.3K 24 Apr 14:28 push_config.yaml
-rw------- 1 rengonca staff 484B 25 Apr 00:40 secrets.yaml
drwxr-xr-x 4 rengonca staff 128B 24 Apr 14:28 templates
(myansible) ➜ Automation_Webinar git:(master)

I downloaded the rpm file as well:

(myansible) ➜ Automation_Webinar git:(master) ✗ ls files
f5-declarative-onboarding-1.12.0-1.noarch.rpm

However, I am facing the following problem:

TASK [Install DO] **********************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "rpm -qp --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' /Users/rengonca/Documents/GitHub/Automation_Webinar/files/f5-declarative-onboarding-1.12.0-1.noarch.rpm", "msg": "[Errno 2] No such file or directory", "rc": 2}

PLAY RECAP *****************************************************************************************************************************************************************************************************************
localhost : ok=5 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Any idea what I should do to fix it?

Regards
RG

@rmarcandier13
Copy link
Author

I was able to advance with this playbook installing RPM on my mac using Brew (brew install rpm)

Now I am facing the following problem:

TASK [Install DO] **********************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "{"code":400,"message":"URI path /mgmt/tm/sys not registered. Please verify URI is supported and wait for /available suffix to be responsive.","restOperationId":56593,"kind":":resterrorresponse"}"}

@rmarcandier13 rmarcandier13 changed the title [Errno 2] No such file or directory "URI path /mgmt/tm/sys not registered. Please verify URI is supported and wait for /available suffix to be responsive." Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant