Skip to content

Instantly share code, notes, and snippets.

@jahkeup
Last active December 21, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jahkeup/784b412d5530900b9148 to your computer and use it in GitHub Desktop.
Save jahkeup/784b412d5530900b9148 to your computer and use it in GitHub Desktop.
{% set openstack = pillar['openstack'] %}
service-tenant:
keystone.service_present:
- name: {{openstack['auth']['service']}}
- description: Service Tenant
{% for service in ['nova','quantum','cinder','glance','swift'] %}
{% set setup = pillar['openstack'][service]['service'] -%}
{% set tenant = salt['keystone.tenant_get'](openstack['auth']['service']) %}
{% if not tenant.get('Error') %}
{{service}}-service-user:
keystone.user_present:
- name: {{setup['username']}}
- password: {{setup['password']}}
- tenant_id: {{salt['keystone.tenant_get'](openstack['auth']['service'])['id']}}
- require:
- keystone.service_present: service-tenant
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment