Fix up the swift-proxy runs

* Fix some typoes
* Add haproxy for swift-proxy
* Add swift_vars
* Remove redundant tasks that are handled by container_common

Conflicts:
	rpc_deployment/roles/swift_common/tasks/main.yml
This commit is contained in:
Andy McCrae 2014-09-25 16:28:38 +00:00 committed by Andy McCrae
parent 71d5cb75ce
commit d9c81a3287
10 changed files with 91 additions and 47 deletions

View File

@ -145,3 +145,6 @@ rpc_support_holland_password:
## Kibana Options
kibana_password:
# Swift Options:
swift_service_password:

View File

@ -16,6 +16,11 @@
# The variables file used by the playbooks in the Cinder-api group.
# These don't have to be explicitly imported by vars_files: they are autopopulated.
####### TODO: ADDING BOGUS VARS THAT SHOULD BE CONFIGURABLE VIA RPC_USER_CONFIG
authtoken_active: True
delay_auth_decision: true
## Service Name
service_name: swift
@ -36,10 +41,10 @@ container_lvm_fssize: 5GB
# driver: cinder.volume.drivers.lvm.LVMISCSIDriver
# backend_name: LVM_iSCSI
swift_proxy_port: "{{ swift_proxy_port|default('8080') }}"
swift_object_port: "{{ swift_object_port|default('6000') }}"
swift_container_port: "{{ swift_container_port|default('6001') }}"
swift_account_port: "{{ swift_account_port|default('6002') }}"
swift_proxy_port: "8000"
swift_object_port: "6000"
swift_container_port: "6001"
swift_account_port: "6002"
## DB
container_mysql_user: swift
@ -48,7 +53,7 @@ container_database: swift
## Cinder Auth
service_admin_tenant_name: "service"
service_admin_username: "swiftr"
service_admin_username: "swift"
service_admin_password: "{{ swift_service_password }}"
## Cinder User / Group

View File

@ -1,6 +1,6 @@
---
- name: "swift account server configuration"
template: src=account-server.conf.j2 dest=/etc/swfit/account-server.conf.j2 owner={{ swift }} mode=0644
template: src=account-server.conf.j2 dest=/etc/swift/account-server.conf.j2 owner={{ swift }} mode=0644
notfiy:
- (re)start account server
- (re)start account auditor

View File

@ -1,16 +1,12 @@
---
- name: "Setup hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
#- name: "Setup hosts file"
# lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
# when: hostvars[item].ansible_default_ipv4.address is defined
# with_items: groups['all']
# If target is a debian/ubuntu system
- include: debian.yml
when: ansible_os_family == 'Debian'
# If target is a centos/redhat system
- include: redhat.yml
when: ansible_os_family == 'RedHat'
#- name: "Install Debian/Ubuntu common swift packages"
# apt: pkg={{ item }} state=installed update_cache=yes
# with_items: ${container_packages}
- name: "Create swift group"
group: name={{ user }} state=present system=yes
@ -18,20 +14,20 @@
- name: "Create a swift user"
user: name={{ user }} state=present shell=/bin/false home=/opt/swift system=yes
- name: "Checkout git repo"
git: repo={{ swift_repo }} version={{ swift_repo_tag }} dest=/opt/swift/swift update=yes
notify:
- Install swift dependencies
- Install swift
#- name: "Checkout git repo"
# git: repo={{ swift_repo }} version={{ git_tag }} dest=/opt/swift/swift update=yes
# notifiy:
# - Install swift dependencies
# - Install swift
- name: "Swift directory"
file: path=/etc/swift owner={{ user }} group={{ user }} state=directory
#- name: "Swift directory"
# file: path=/etc/swift owner={{ user }} group={{ user }} state=directory
- name: "Swift lock directory"
file: path=/var/lock/swift owner={{ user }} group={{ user }} state=directory
#- name: "Swift lock directory"
# file: path=/var/lock/swift owner={{ user }} group={{ user }} state=directory
- name: "Swift log directory"
file: path=/var/log/swift owner={{ user }} group=adm state=directory
#- name: "Swift log directory"
# file: path=/var/log/swift owner={{ user }} group=adm state=directory
- name: "Setup swift.conf"
template: src=swift.conf.j2 dest=/etc/swift/swift.conf owner={{ user }} mode=0644

View File

@ -1,6 +1,6 @@
---
- name: "swift container server configuration"
template: src=container-server.conf.j2 dest=/etc/swfit/container-server.conf.j2 owner={{ swift }} mode=0644
template: src=container-server.conf.j2 dest=/etc/swift/container-server.conf.j2 owner={{ swift }} mode=0644
notfiy:
- (re)start container server
- (re)start container auditor

View File

@ -1,6 +1,6 @@
---
- name: "swift object server configuration"
template: src=object-server.conf.j2 dest=/etc/swfit/object-server.conf.j2 owner={{ swift }} mode=0644
template: src=object-server.conf.j2 dest=/etc/swift/object-server.conf.j2 owner={{ swift }} mode=0644
notfiy:
- (re)start object server
- (re)start object auditor

View File

@ -1,3 +1,17 @@
---
- name: (re)start proxy server
# 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.
- name: Restart proxy server
command: swift-init proxy-server restart

View File

@ -1,11 +1,28 @@
---
- name: "install the keystone auth_token middleware"
pip: name=keystonemiddleware
# 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.
- name: "swift object server configuration"
template: src=proxy-server.conf.j2 dest=/etc/swfit/proxy-server.conf.j2 owner={{ swift }} mode=0644
notfiy:
- (re)start proxy server
- name: swift proxy server configuration
template: >
src="proxy-server.conf.j2"
dest="/etc/swift/proxy-server.conf"
owner={{ service_admin_username }}
mode=0644
notify: Restart proxy server
- name: "Set proxy server to start at boot"
cron: special_time=reboot job="swift-init proxy-server start"
- name: Set proxy server to start at boot
cron: >
name="Restart swift proxy at boot"
special_time=reboot
job="swift-init proxy-server start"

View File

@ -1,10 +1,10 @@
[DEFAULT]
bind_ip = {{ inventory_host }}
bind_port = 8080
bind_ip = 0.0.0.0
bind_port = {{ swift_proxy_port }}
# bind_timeout = 30
# backlog = 4096
# swift_dir = /etc/swift
user = {{ user }}
user = {{ system_user }}
# Enables exposing configuration settings via HTTP GET /info.
# expose_info = true
@ -277,13 +277,14 @@ paste.filter_factory = keystonemiddleware.auth_token:filter_factory
auth_host = {{ auth_host }}
auth_port = {{ auth_port }}
auth_protocol = {{ auth_protocol }}
auth_uri = {{ auth_uri }}
admin_tenant_name = {{ admin_tenant_name }}
admin_user = {{ admin_user }}
admin_password = {{ admin_password }}
auth_uri = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}
admin_tenant_name = {{ service_admin_tenant_name }}
admin_user = {{ service_admin_username }}
admin_password = {{ service_admin_password }}
delay_auth_decision = {{ delay_auth_decision }}
# cache = swift.cache
# include_service_catalog = False
{% endif %}
#
[filter:keystoneauth]
use = egg:swift#keystoneauth
@ -315,7 +316,7 @@ use = egg:swift#memcache
# memcache.conf (see memcache.conf-sample) or lacking that file, it will
# default to the value below. You can specify multiple servers separated with
# commas, as in: 10.1.2.3:11211,10.1.2.4:11211
memcache_servers = {{ memcache_servers }}
memcache_servers = {{ internal_vip_address }}:{{ memcached_port }}
#
# Sets how memcache values are serialized and deserialized:
# 0 = older, insecure pickle serialization

View File

@ -178,3 +178,11 @@ haproxy_config:
hap_backend_alg: source
hap_backend_options:
- "ssl-hello-chk"
- service:
hap_service_name: swift_proxy
hap_backend_nodes: "{{ groups['swift_proxy'] }}"
hap_port: 8000
hap_balance_type: http
hap_backend_alg: source
hap_backend_options:
- "ssl-hello-chk"