75 lines
3.8 KiB
YAML
75 lines
3.8 KiB
YAML
# Copyright (c) 2016 OpenStack Foundation
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the Liscense.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# TODO(eran): Get the enabled flag name from config file
|
|
- name: Set account metadata in swift -- enable storlets
|
|
command: swift post
|
|
--os-auth-url="{{ keystone_public_url }}"
|
|
--os-username="{{ storlets_default_tenant_user_name }}"
|
|
--os-password="{{ storlets_default_tenant_user_password }}"
|
|
--os-tenant-name="{{ storlets_default_tenant_name }}"
|
|
--meta "Storlet-Enabled:True"
|
|
|
|
# TODO(eran): Get the log container name from config file
|
|
- name: create the Swift log container
|
|
command: swift post
|
|
--os-auth-url="{{ keystone_public_url }}"
|
|
--os-username="{{ storlets_default_tenant_user_name }}"
|
|
--os-password="{{ storlets_default_tenant_user_password }}"
|
|
--os-tenant-name="{{ storlets_default_tenant_name }}"
|
|
log
|
|
|
|
# TODO(eran): Get the storlet container name from config file
|
|
- name: create the Swift storlet container
|
|
command: swift post
|
|
--os-auth-url="{{ keystone_public_url }}"
|
|
--os-username="{{ storlets_default_tenant_user_name }}"
|
|
--os-password="{{ storlets_default_tenant_user_password }}"
|
|
--os-tenant-name="{{ storlets_default_tenant_name }}"
|
|
--read-acl "{{ storlets_default_tenant_name }}:{{ storlets_default_tenant_member_user }}"
|
|
storlet
|
|
|
|
# TODO(eran): Get the dependency container name from config file
|
|
- name: create the Swift dependency container
|
|
command: swift post
|
|
--os-auth-url="{{ keystone_public_url }}"
|
|
--os-username="{{ storlets_default_tenant_user_name }}"
|
|
--os-password="{{ storlets_default_tenant_user_password }}"
|
|
--os-tenant-name="{{ storlets_default_tenant_name }}"
|
|
dependency
|
|
|
|
# TODO(eran): Get the docker_images container name from config file
|
|
# This is for future use when we bring back the management stuff
|
|
# Specifically note the acls given to the storlet manager
|
|
- name: create the Swift docker_images container
|
|
command: swift post
|
|
--os-auth-url="{{ keystone_public_url }}"
|
|
--os-username="{{ storlets_default_tenant_user_name }}"
|
|
--os-password="{{ storlets_default_tenant_user_password }}"
|
|
--os-tenant-name="{{ storlets_default_tenant_name }}"
|
|
--read-acl "{{ storlet_management_account }}:{{ storlet_management_admin_username }}"
|
|
--write-acl "{{ storlet_management_account }}:{{ storlet_management_admin_username }}"
|
|
docker_images
|
|
|
|
- name: test if need to create member user
|
|
shell: openstack --os-auth-url={{ keystone_public_url }} --os-username={{ keystone_admin_user }} --os-password={{ keystone_admin_password }} --os-project-name={{ keystone_admin_project }} user list --project "{{ storlets_default_tenant_name }}" | grep "{{ storlets_default_tenant_member_user }}" | wc -l
|
|
register: member_user
|
|
|
|
- debug: msg="{{ member_user }}"
|
|
|
|
- name: Create member user
|
|
shell: openstack --os-auth-url={{ keystone_public_url }} --os-username={{ keystone_admin_user }} --os-password={{ keystone_admin_password }} --os-project-name={{ keystone_admin_project }} user create --project "{{ storlets_default_tenant_name }}" --password "{{ storlets_default_tenant_member_password }}" --enable "{{ storlets_default_tenant_member_user }}"
|
|
when: "'0' in member_user.stdout"
|