New version of salt-formula from Saltstack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3KB

  1. {% from "salt/map.jinja" import control with context %}
  2. {%- for provider_name, provider in control.provider.iteritems() %}
  3. {{ provider_name }}:
  4. provider: {{ provider.engine }}
  5. {%- if provider.insecure is defined %}
  6. insecure: true
  7. {%- endif %}
  8. {%- if provider.engine == 'openstack' %}
  9. identity_url: '{{ provider.identity_url }}'
  10. {%- if provider.compute_name is defined %}
  11. compute_name: {{ provider.get('compute_name', 'nova') }}
  12. {%- endif %}
  13. protocol: ipv4
  14. compute_region: {{ provider.region }}
  15. tenant: {{ provider.tenant }}
  16. user: {{ provider.user }}
  17. {%- if provider.api_key is defined %}
  18. apikey: {{ provider.api_key }}
  19. {%- elif provider.password is defined %}
  20. password: {{ provider.password }}
  21. {%- endif %}
  22. ssh_key_name: salt-cloud
  23. ssh_key_file: /root/.ssh/id_rsa
  24. ssh_interface: {{ provider.get('interface', 'private') }}_ips
  25. networks:
  26. - fixed:
  27. {%- for net in provider.fixed_networks %}
  28. - {{ net }}
  29. {%- endfor %}
  30. - floating:
  31. {%- for net in provider.floating_networks %}
  32. - {{ net }}
  33. {%- endfor %}
  34. {%- if provider.ignore_cidr is defined %}
  35. ignore_cidr: {{ provider.ignore_cidr }}
  36. {%- endif %}
  37. {%- elif provider.engine == 'digital_ocean' %}
  38. {#- location: {{ provider.region }} #}
  39. personal_access_token: {{ provider.api_key }}
  40. {%- endif %}
  41. {%- endfor %}