Hi,

I hope you are well.

Can you please someone help me with how to reference nest dictionaries in a 
playbook?

I would like to refer pypi, hosted and repo_list as variables in a playbook.

vars:


pypi:

 hosted:

   repo_list:

     - name: data_services_pypi_001

       online: true

       storage:

         blobStoreName: default

         writePolicy: allow_once

         strictContentTypeValidation: true

     - name: devops-pypi-001

       online: true

       storage:

         blobStoreName: default

         writePolicy: allow_once

         strictContentTypeValidation: true


Task:

- name: Create pypi hosted Repos

  uri:

    url: "{{ nexus_api_scheme }}://{{ nexus_api_hostname }}:{{ 
nexus_api_port }}\

      {{ nexus_api_context_path }}{{ nexus_rest_api_endpoint 
}}/repositories/*pypi*/*hosted*"

    user: "{{ nexus_api_user }}"

    password: "{{ nexus_default_admin_password }}"

    headers:

      accept: "application/json"

      Content-Type: "application/json"

    body_format: json

    method: POST

    force_basic_auth: yes

    validate_certs: "{{ nexus_api_validate_certs }}"

    body: "{{  repo_list  }}"

    status_code: 201

  no_log: no

  with_flattened: "{{ pypi_hosted_repo_list }}"



Thanks in advance!

-- 
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/4e028f0a-a5fa-4f55-a189-2598f487c757n%40googlegroups.com.

Reply via email to