From 4da4e7735ad90952149e6fadac0a0315a8f18dce Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Tue, 30 Sep 2014 10:33:47 +0000 Subject: [PATCH] Fix keystone endpoint creation for Swift * Setup the keystone endpoint for swift * Move swift-proxy port to 8888 (8000 is used by heat) * Typo prevented object server services from restarting * Adjust order of swift plays for swift-all.yml --- .../inventory/group_vars/swift_all.yml | 2 +- .../openstack/keystone-add-all-services.yml | 9 ++++++++ .../playbooks/openstack/swift-all.yml | 2 +- .../playbooks/openstack/swift-build-rings.yml | 1 + .../roles/swift_account/tasks/main.yml | 2 +- .../roles/swift_object/handlers/main.yml | 2 +- .../vars/config_vars/haproxy_config.yml | 2 +- .../swift_proxy_endpoint.yml | 22 +++++++++++++++++++ scripts/uklabsetup.sh | 2 ++ 9 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 rpc_deployment/vars/openstack_service_vars/swift_proxy_endpoint.yml diff --git a/rpc_deployment/inventory/group_vars/swift_all.yml b/rpc_deployment/inventory/group_vars/swift_all.yml index d6979fbab3..1f5494997b 100644 --- a/rpc_deployment/inventory/group_vars/swift_all.yml +++ b/rpc_deployment/inventory/group_vars/swift_all.yml @@ -41,7 +41,7 @@ container_lvm_fssize: 5GB # driver: cinder.volume.drivers.lvm.LVMISCSIDriver # backend_name: LVM_iSCSI -swift_proxy_port: "8000" +swift_proxy_port: "8888" swift_object_port: "6000" swift_container_port: "6001" swift_account_port: "6002" diff --git a/rpc_deployment/playbooks/openstack/keystone-add-all-services.yml b/rpc_deployment/playbooks/openstack/keystone-add-all-services.yml index bb146ec33a..9a262f6ee3 100644 --- a/rpc_deployment/playbooks/openstack/keystone-add-all-services.yml +++ b/rpc_deployment/playbooks/openstack/keystone-add-all-services.yml @@ -111,3 +111,12 @@ vars_files: - inventory/group_vars/nova_all.yml - vars/openstack_service_vars/nova_api_s3_endpoint.yml + +# Swift endpoint +- hosts: keystone[0] + user: root + roles: + - keystone_add_service + vars_files: + - inventory/group_vars/swift_all.yml + - vars/openstack_service_vars/swift_proxy_endpoint.yml diff --git a/rpc_deployment/playbooks/openstack/swift-all.yml b/rpc_deployment/playbooks/openstack/swift-all.yml index 4937c69a10..e4042d6d1b 100644 --- a/rpc_deployment/playbooks/openstack/swift-all.yml +++ b/rpc_deployment/playbooks/openstack/swift-all.yml @@ -13,6 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. +- include: swift-build-rings.yml - include: swift-proxy.yml - include: swift-storage.yml -- include: swift-build-rings.yml diff --git a/rpc_deployment/playbooks/openstack/swift-build-rings.yml b/rpc_deployment/playbooks/openstack/swift-build-rings.yml index da2c40f256..0a1ac2e330 100644 --- a/rpc_deployment/playbooks/openstack/swift-build-rings.yml +++ b/rpc_deployment/playbooks/openstack/swift-build-rings.yml @@ -4,6 +4,7 @@ roles: - { role: container_common, tags: [ 'directories' ] } - openstack_common + - swift_common - swift_ring_builder vars_files: - inventory/group_vars/swift_all.yml diff --git a/rpc_deployment/roles/swift_account/tasks/main.yml b/rpc_deployment/roles/swift_account/tasks/main.yml index 914c99e090..fbc6c4a853 100644 --- a/rpc_deployment/roles/swift_account/tasks/main.yml +++ b/rpc_deployment/roles/swift_account/tasks/main.yml @@ -13,7 +13,7 @@ - name: "Set account server to start at boot" cron: > - name="Restart account-sever on boot" + name="Restart account-server on boot" special_time=reboot job="swift-init account-server start" diff --git a/rpc_deployment/roles/swift_object/handlers/main.yml b/rpc_deployment/roles/swift_object/handlers/main.yml index 3bce44e32e..20f0f616ef 100644 --- a/rpc_deployment/roles/swift_object/handlers/main.yml +++ b/rpc_deployment/roles/swift_object/handlers/main.yml @@ -8,5 +8,5 @@ - name: Restart object replicator command: swift-init object-replicator restart -- name: Retart object updater +- name: Restart object updater command: swift-init object-updater restart diff --git a/rpc_deployment/vars/config_vars/haproxy_config.yml b/rpc_deployment/vars/config_vars/haproxy_config.yml index b5a575307a..e4e6a9ee3b 100644 --- a/rpc_deployment/vars/config_vars/haproxy_config.yml +++ b/rpc_deployment/vars/config_vars/haproxy_config.yml @@ -181,7 +181,7 @@ haproxy_config: - service: hap_service_name: swift_proxy hap_backend_nodes: "{{ groups['swift_proxy'] }}" - hap_port: 8000 + hap_port: 8888 hap_balance_type: http hap_backend_alg: source hap_backend_options: diff --git a/rpc_deployment/vars/openstack_service_vars/swift_proxy_endpoint.yml b/rpc_deployment/vars/openstack_service_vars/swift_proxy_endpoint.yml new file mode 100644 index 0000000000..a2ddcf9510 --- /dev/null +++ b/rpc_deployment/vars/openstack_service_vars/swift_proxy_endpoint.yml @@ -0,0 +1,22 @@ +--- +# Copyright 2014, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +service_type: object-store +service_description: "Object Storage Service" +service_password: "{{ swift_service_password }}" + +service_publicurl: "http://{{ external_vip_address }}:{{ swift_proxy_port }}/v1/AUTH_%(tenant_id)s" +service_adminurl: "http://{{ internal_vip_address }}:{{ swift_proxy_port }}/v1/AUTH_%(tenant_id)s" +service_internalurl: "http://{{ internal_vip_address }}:{{ swift_proxy_port }}/v1/AUTH_%(tenant_id)s" diff --git a/scripts/uklabsetup.sh b/scripts/uklabsetup.sh index 2cacc5eeca..31fee39707 100755 --- a/scripts/uklabsetup.sh +++ b/scripts/uklabsetup.sh @@ -32,5 +32,7 @@ pushd /root/ansible-lxc-rpc # Openstack Service Setup ansible-playbook -e @/etc/rpc_deploy/user_variables.yml playbooks/openstack/openstack-setup.yml + + ansible-playbook -e @/etc/rpc_deploy/user_variables.yml playbooks/openstack/swift-all.yml popd popd