Hi ,

I have the below uri module to post the details inside the web api

- name: REST POST Example
  uri:
    url: "{{ webapp_url }}/api/orgs"
    method: POST
    return_content: yes
    body: "{ \"name\": \"{{ project_name }}\" }"
    body_format: json
    validate_certs: no
    user: "{{ user }}"
    password: "{{ password }}"
    force_basic_auth: yes

while passing the variables as 
ansible-playbook myplay.yml  -e "project_name=first_project"  
n- number of times it works and overwrites the same first_project name.

Is there an option available to stop overwriting if the same project_name 
is  available with uri module? 
Or we have to use the GET method  to collect and compare the existing 
project_name , before writing using POST? or will  a conditional check can 
help ?


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1e1f7f5f-ea12-4349-9375-a2e1a8e22ef4n%40googlegroups.com.

Reply via email to