0

I am executing the same request/task against an api with the uri module. When I execute from a mac on python 3.7.1 and ansible 2.8.1, it works. When I execute from a red hat linux machine with python 2.7.5 and ansible 2.4.2.0, it doesn't work and I get the error 'dict object' has no attribute 'json'

Here is the task with dummy values:

  - name: get request
    uri:
      url: https://url.com{{ foo }}
      method: GET
      user:  user
      validate_certs: False
      password: password
      return_content: yes
      body_format: json
    register: page_contents
    until: page_contents.json.{{ foo }}[0].status == "deployed"
    retries: 30
    delay: 5
Corey
  • 170
  • 2
  • 11
  • Initially thought this was an issue with executing roles. Tested just executing the task on the remote machine and it also failed. Guessing my problem has to do with the versions. I will update and follow up. – Corey Jan 27 '20 at 22:22

1 Answers1

0

I updated both the ansible and python versions to the most recent ones and now it works fine.

Corey
  • 170
  • 2
  • 11