Hi, I have a plabyook that checks if my python app has been installed and 
only run pip install if the packages have not been installed.

Unfortunately because I'm doing a check using with_items the register value 
is a dictionary causing an error on the next when: statement when 
evaluating the conditional..

# CODE:

- name: check if {{ item }} have been previously installed
  shell: python -c "import {{ item }}"
  register: python_result
  ignore_errors: True
  with_items:
    - app1
    - app2

- name: pip install {{ item }}
  pip: requirements=/packages/{{ item }}/requirements.txt
  sudo_user: deploy
  with_items:
    - app1
    - app2
  when: python_result.rc == 1


# Error output running with full verbosity (-vvvvvvv) :

TASK: [pip install {{ item }}] *****************************************
fatal: [server.example.co] => error while evaluating conditional: 
python_result.rc == 1


Any help please ? 

Regards,
N.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c1e6428e-5989-42c5-9d68-9c8c8e699448%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to