Hello,

I am testing OpenStack modules and I wonder if it's possible to somehow 
"pre-define" a dictionary for a resource to avoid repeating parameter 
declarations. I have:

---
  - quantum_network:
      auth_url: "{{ lookup('env', 'OS_AUTH_URL') }}"
      login_username: "{{ lookup('env', 'OS_USERNAME') }}"
      login_password: "{{ lookup('env', 'OS_PASSWORD') }}"
      login_tenant_name: "{{ lookup('env', 'OS_TENANT_ID') }}"

      name: "{{ network_name }}"

  - quantum_subnet:
      auth_url: "{{ lookup('env', 'OS_AUTH_URL') }}"
      login_username: "{{ lookup('env', 'OS_USERNAME') }}"
      login_password: "{{ lookup('env', 'OS_PASSWORD') }}"
      login_tenant_name: "{{ lookup('env', 'OS_TENANT_ID') }}"

      cidr: "{{ subnet_cidr }}"
      name: "{{ subnet_name }}"
[end of YAML]

All the OpenStack modules have the 4 authentication parameters, and I would 
like to somehow remove the duplicity of declaring them every time again.

If it would be some OOP oriented programming language, I would create an 
abstract class and inherit. If it would be python, I would create a base 
dict and then copy it and extend it. I am not sure how to achieve this in 
Ansible and YAML.

Is there a way to declare the auth values only one time?

Thanks.

Cheers,
Tomas

-- 
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/eae96cd0-a2f0-4b25-9a60-80ba113f7649%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to