147 Commits

Author SHA1 Message Date
Jenkins
a1a7e31f71 Merge "[DOCS] Cleaned up Swift README" 2016-03-09 07:14:13 +00:00
Andy McCrae
17c7c08f29 Enable developer mode
This commit adds the ability to install cinder without a repo server.
This pattern is lifted from the os_keystone role and allows us to
further develop functional testing for this role.

Change-Id: I85ba753a946b22ee3e9b9403977501a1804f9d86
Partial-Bug: #1553967
2016-03-08 16:46:08 +00:00
Jenkins
5bb3ab739a Merge "Fix auth_url for swift configuration" 2016-03-08 04:18:57 +00:00
Jenkins
d0a05d3020 Merge "Configure Swift dispersion tools to use Keystone v3" 2016-03-07 19:34:46 +00:00
Travis Truman
a304203057 Use swift_syslog_* vars for consistency
The task above uses them. We default them in the role
so we should use them everywhere.

Change-Id: Ia36220522fda07a199b59ece748d8f81e71dc313
2016-03-06 16:56:30 -05:00
Jenkins
5b40c64073 Merge "Removing unneeded with_items usage for clarity" 2016-03-05 22:47:17 +00:00
Bjoern Teipel
ec6439a54e Fix auth_url for swift configuration
This fix configures the auth_url parameter to use keystone_service_adminurl
over the existing keystone_service_adminuri parameter which actually leads
to a incomplete URL lacking the API version like /v3/tokens

Change-Id: I46f2ab7cbdb579dda5d019c29950af7e8c974bea
Related-Bug: #1552394
2016-03-04 16:46:16 -06:00
Jesse Pretorius
27cf4973c1 Add curl to bindep requirements
Change-Id: I406ff5225a3a6720d24fa3f01ba93976ec24e75c
2016-03-04 19:24:04 +00:00
Travis Truman
fa3b7d1079 Configure Swift dispersion tools to use Keystone v3
Change-Id: I6c5b318a9b08ad66dfcaf476df25018152ef577c
Closes-Bug: #1544425
2016-03-04 13:36:48 -05:00
Jenkins
afcf86c50f Merge "Enable SSL termination for all services" 2016-03-04 17:54:28 +00:00
Jenkins
874646a495 Merge "Fix Swift log directory ownership" 2016-03-03 22:51:48 +00:00
Jenkins
c035320f7e Merge "Changed the ordering for sudoers where used" 2016-03-03 20:05:09 +00:00
Kevin Carter
77f6ab08b0 Enable SSL termination for all services
This change makes it so that all services are expecting SSL termination
at the load balancer by default. This is more indicative of how a real
world deployment will be setup and is being added such that we can test
a more production like deployment system by default.

The AIO will now terminate SSL in HAProxy using a self-signed cert.

Change-Id: I6273ffa453b4e5eb8a33767974d390a126296c47
Re-Implementation-Of: https://review.openstack.org/#/c/277199/9
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-03-03 10:46:36 -06:00
Kevin Carter
83c53d13b3 Changed the ordering for sudoers where used
The sudoers file was being created in the pre-install tasks
which causes an incorrect configuration variable to be dropped
when the venv env is not turned on. To correct this issue the
sudoers template is now dropped in the post install task file
after the bin_path fact has been set.

This change also removes the directory create task for heat, keystone,
glance, and swift because no sudoers files are needed for these services.

Re-Implementation-Of: https://review.openstack.org/#/c/277674/1
Change-Id: I609c9c12579dc1897787d19a1f58fe3e919b5e35
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-03-03 09:48:43 -06:00
Jesse Pretorius
f8b0c2a0cd Initial commit for bindep requirements
Change-Id: Idc52793824d03e8c7288736e966b16d42f6eb867
2016-03-03 15:15:39 +00:00
Travis Truman
9327153c3a [DOCS] Cleaned up Swift README
Providing a better playbook example and
fixing naming.

Change-Id: Iea83cb77478480fad67a25f7c990df74af1e1167
2016-03-03 09:38:05 -05:00
Travis Truman
d610c38646 Removing unneeded with_items usage for clarity
Change-Id: I50a97ab64ab1db8be6fad7479301b1cc0abe9ba9
2016-03-03 14:07:54 +00:00
Travis Truman
cc81926655 Adding Vagrantfile for local developer testing
CONTRIBUTING.rst updated to include instructions on
how to use the Vagrantfile for running tests.

Change-Id: I27725e6e9187df012f548849d2e1c0d37d600e23
2016-03-02 15:43:59 -05:00
Andy McCrae
fb9da7aa18 Fix Swift log directory ownership
This PR sets the ownership for the swift log directories to the syslog
user instead of the swift user. Since swift uses syslog, no logs were
being created/logged to before this change.

Change-Id: I44768d4cd04108a7163169dfec2f0de774a2cf83
2016-03-02 17:31:38 +00:00
Kevin Carter
445f76ff94
Implement base configuration for independent repository
Change-Id: Ia0c83a480487746b70e2404137800080842526f7
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-03-01 15:03:17 -06:00
Jenkins
a771371373 Merge "Move swift memcache conf into separate file" 2016-02-17 13:12:35 +00:00
Andy McCrae
2aa3598893 Move swift memcache conf into separate file
The memcache configuration was only setup for the proxy-server.conf
within Swift, and was not set for the object and container reconcilers
which both use memcache.

This patch moves the memcache settings into a separate memcache.conf
file which is then configured on all swift hosts, removing the specific
conf from the proxy-server.conf file.

Change-Id: I047b2d1178de43c694c30280f6ed9fe8511341fd
Closes-Bug: #1542121
2016-02-10 16:29:17 +00:00
Jean-Philippe Evrard
0e2d72bf19 Only update apt cache if necessary
Workarounding the upstream ansible apt module bug
documented here:
https://github.com/ansible/ansible-modules-core/pull/1517

For the next versions of ansible we'll be using, we should
check if the apt bug is fixed. When it's fixed, we could
abandon this change and use the standard apt module
with correct cache handling.

Change-Id: I2aaf00da175f31d0157bbc4ae30a4e176b055078
2016-02-09 16:46:22 +01:00
Jenkins
847d186972 Merge "Fix rsync service restart in os_swift" 2016-02-02 16:59:49 +00:00
Jenkins
fac0b2d2a5 Merge "Re-deploy the Swift venv if it mismatches the repo" 2016-01-28 21:56:04 +00:00
Matt Thompson
94b72365ac Re-deploy the Swift venv if it mismatches the repo
We currently have two issues with venvs:

- if you update your venv on the repo server, it is not possible for
  that updated venv to land on the service's container as the get_url
  task always skips if the file exists (even if the file is different)
- if you have an updated venv on the repo server and forcefully delete
  the cached venv tarball on the service's container, the new tarball
  will get unarchived over top of the existing venv

This commit does the following:

- gets the checksum of the /var/cache tarball and downloads checksum
  file from repo server
- updates "Attempt venv download" to only download the venv if the
  cache doesn't exist or if the local and remote checksums differ
- adds a "force: true" to "Attempt venv download" task so that the venv
  tarball will get re-downloaded when the when condition is true (this
  is necessary otherwise the download will get skipped since the
  destination already exists)
- adds a new task "Remove existing venv" so we can first remove the
  venv before we unarchive the potentially new venv from the repo
  server
- updates "Create swift venv dir" and "Unarchive pre-built venv"
  tasks to only proceed if "swift_get_venv | changed", which
  prevents these tasks from running when they the venv tarball hasn't
  changed
- adds multiple service restarts to
  os_swift/tasks/swift_install.yml so that swift will restart
  correctly should the venv/packages update without any associated
  config changes

NOTE: The reason why we compare local and remote checksum is to avoid
      unnecessarily downloading the venv when the checksums are in fact
      the same.  On small deploys this is more or less a non-issue but
      if a deploy w/ thousands of compute nodes re-runs playbooks we
      want to limit the venv downloads when it's unnecessary.

Change-Id: I4b028f6e4ca59eceac010d2bbc10a8d79f6f3937
2016-01-28 09:11:56 +00:00
git-harry
8a9605ba57 Fix rsync service restart in os_swift
The rsync service is currently restarted using two handlers, one to stop
the service and a second to start it. There is not a sufficient delay
between the two task and so the rsync pid has not been removed before
the attempt is made to start the service.

This commit replaces the two handlers with a single one that will do the
restart in one go.

Change-Id: I8ed4630da1add7205552b6ec731a143dbe45112b
Closes-bug: 1538649
2016-01-27 16:51:14 +00:00
Ian Cordasco
290c680d96 Make all install actions consistently use with_items
This is primarily a style fix, not a functional one.

Related-Bug: #1495748
Change-Id: Ia34e01bced2d0287dab5353f975f36f9323cd205
2016-01-21 15:59:49 +00:00
Jenkins
4845e8e913 Merge "Add statsd configuration for swift" 2016-01-15 08:11:21 +00:00
You Wei Wang
0594488f99 Trivial: Remove vim header from source files
Change-Id: I68a7d910d45ef5bbbc8b59d9bc363fa68c6a8663
2016-01-14 10:52:17 +00:00
Matthew Oliver
c79547cb91 Add statsd configuration for swift
This adds the optional configuration options:
  - statsd_host
  - statsd_port
  - statsd_metric_prefix (defaults to inventory_hostname)
  - statsd_default_sample_rate
  - statsd_sample_rate_factor

Which can be defined under swift globally or on the server level.
The configuration will only be added if statsd_host is defined.

Change-Id: I793b189e0a1f5ca4fc1fe17b1d89f2a83af8c796
2016-01-14 10:20:41 +00:00
Jenkins
f97db4da18 Merge "Skip Keystone task when not using swift w keystone" 2015-12-15 16:12:53 +00:00
Andy McCrae
c584902590 Skip Keystone task when not using swift w keystone
It's possible to remove keystoneauth from the middleware pipeline,
but the play will fail because the keystone swift User/roles/perms
tasks will not be able to succeed.

This patch skips those tasks when not using keystoneauth in the
middleware pipeline.

Change-Id: I87143b5c220dc312e2cb5d7e3dd3e9e01609ff91
Closes-Bug: #1523581
2015-12-09 14:22:27 +00:00
Kevin Carter
a251528bef Fixes playbook runtime issues with ldap
When using an LDAP backend the plabooks fail when "ensuring.*"
which is a keystone client action. The reason for the failure is
related to how ldap backend, and is triggered when the service
users are within the ldap and not SQL. To resolve the issue a boolean
conditional was created on the various OS_.* roles to skip specific
tasks when the service users have already been added into LDAP.

Change-Id: I64a8d1e926c54b821f8bfb561a8b6f755bc1ed93
Closes-Bug: #1518351
Closes-Bug: #1519174
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-12-07 08:59:05 -06:00
Matthew Oliver
5a6a1c51b1 Add container-reconciler and object-expirer to os-swift
The container-reconciler and object-expirer were missing from the os-swift
role. The reconciler  makes sure incorrectly placed objets live in the
correct storage policy. The expirer is the service that deletes expired objects.

This change also adds the abilty to optionally specify a reclaim_age in the swift
section of the configuration, which is now set in all the locations required,
still with the default of 604800 seconds (7 days).

Change-Id: Ic56a714c3fb3c84b9bb5ed8e2ae3c86dad474161
Closes-Bug: #1516877
2015-11-25 21:29:08 +11:00
Kevin Carter
c8639ebd5d Implement shippable venvs
The change builds venvs in a single repo container and then
ships them to to all targets. The built venvs will be within
the repo servers and will allow for faster deployments,
upgrades, and more consistent deployments for the life cycle
of the deployment.

This will create a versioned tarball that will allow for
greater visablility into the build process as well as giving
deployers/developers the ability to compair a release in
place.

Change-Id: Ieef0b89ebc009d1453c99e19e53a36eb2d70edae
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-10-22 18:35:17 -05:00
Jenkins
2aa5e4561f Merge "Put swift {account,container,object} logs where they belong" 2015-10-18 21:40:27 +00:00
Jesse Pretorius
a24f5590a2 Put swift {account,container,object} logs where they belong
The pattern for nova and neutron on hosts is to have a symlink from
/var/log/{service} to /openstack/log/_hostname_-{service}/ and then
to have all the service logs configured to log to /var/log/{service}
as that is a logical place for an operator to look for them.

Swift currently does not follow that pattern.

Currently the swift {account,container,object} logs are placed in
/openstack/log/{hostname}/, whereas the proxy logs are placed in
/var/log/swift/. On hosts the /var/log/swift symlink to
/openstack/log/{hostname}-swift/ is created, but not used.

This creates confusion for operators trying to find the logs in the
logical (and upstream) pattern in the directory /var/log/{service}.

This patch puts the swift logs where they belong.

Upgrade Notes:
 - This changes the location of the log storage on swift hosts from
   /openstack/log/{hostname} to /openstack/log/{hostname}-swift
 - Any log processing or monitoring tooling that consumes swift logs
   will need to be adjusted to consume them from the new location,
   or simply to consume them from /var/log/swift

DocImpact
UpgradeImpact
Closes-Bug: #1417536
Change-Id: I8d6ec98d310ce8d4e4a7a6cc5fb2d349d17757cf
2015-10-16 08:37:25 +01:00
Kevin Carter
9107e62b12 Implement swift venv support
This commit conditionally allows the os_swift role to
install build and deploy within a venv. This is the new
default behavior of the role however the functionality
can be disabled.

In this PR, like all of the other venv related PRs, the 
`is_metal` flag was removed from the role however unlike 
some of the other PRs this removal required moving some 
of the `is_metal` logic out of the role and into the 
play. This was done for consistency as well as making 
the role more standalone. The only thing that the role 
should care about, in terms of installation, is whether 
or not to install in a venv.

Change-Id: I6f5b883a853611659567bd12e8bcf572189854b7
Implements: blueprint enable-venv-support-within-the-roles
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-10-15 17:56:05 +00:00
Jesse Pretorius
8319f0ad42 Allow pip extra arguments to be passed to playbooks
This patch adds the variable 'pip_install_options' which is passed to the pip
install module as extra arguments in order to allow the use of options like
'--force-reinstall' when executing playbooks.

eg: openstack-ansible -e pip_install_options="--force-reinstall" \
        setup-openstack.yml

This is required due to constant upstream changes in dependencies which
result in python wheel version upgrades and downgrades between tagged
versions of openstack-ansible.

The intention is that this can be used whenever a deployer switches between
tags for both upgrades and downgrades.

DocImpact
Closes-Bug: #1489251
Closes-Bug: #1499451
Related-Bug: #1501114
Change-Id: I996185e009a4c4af4f23798619bdbd0d490360c9
2015-09-30 15:18:31 +00:00
git-harry
4666d60f58 Change recon_lock_path to /var/lock
The Swift configuration item [filter:recon]/recon_lock_path is set to
'/var/lock/swift' by openstack-ansible in the appropriate configuration
files. The playbooks also create the directory if it does not exist. If
the host is rebooted the directory '/var/lock/swift' is missing and must
be recreated.

/var/lock (/run/lock) is a tmpfs and so the directory /var/lock/swift
will not persist between reboots.

Swift attempts to create a directory in the directory specified by
recon_lock_path however it does not recursively create any missing
parent directories.

This commit changes the value of [filter:recon]/recon_lock_path to that
set by Swift, '/var/lock'. This allows it to create the directory
'/var/lock/swift-recon-object-cron'. The creation of '/var/lock/swift'
is also removed from the playbooks.

Change-Id: I714367b02c7cf961e9e0bdee4e41f9e4e105b088
Closes-bug: #1496117
2015-09-21 11:18:18 +00:00
Kevin Carter
fd3866ca2a adds the config_template to swift
The change modifies the swift template tasks such that it's now
using the config_template action plugin. This change will make so that
config files can be dynamically updated, by a deployer, at run time,
without requiring the need to modify the in tree templates or defaults.

Partially implements: blueprint tunable-openstack-configuration

Change-Id: Id992937f35afa0549f9f0d0fbcf0be5e6978df57
2015-09-14 23:44:35 -05:00
kevin
a1c29df707 Compartmentalizing RabbitMQ
Presently all services use the single root virtual host within RabbitMQ
and while this is “OK” for small to mid sized deployments however it
would be better to divide services into logical resource groups within
RabbitMQ which will bring with it additional security. This change set
provides OSAD better compartmentalization of consumer services that use
RabbitMQ.

UpgradeImpact
DocImpact
Change-Id: I6f9d07522faf133f3c1c84a5b9046a55d5789e52
Implements: blueprint compartmentalize-rabbitmq
2015-09-11 11:08:50 -05:00
Hugh Saunders
2f56558c6d Remove double register in swift handlers
Change-Id: Ifa224ae4b913c1765c9fd57216ea8cf2f34bde82
2015-09-04 11:30:21 +01:00
Jenkins
ca8186b32d Merge "Ensure rsync restarts fully during swift setup" 2015-09-03 14:52:58 +00:00
Steve Lewis
e673b64caa Add sorting_method to swift proxy config as needed
When read_affinity is used and sorting_method is not used warnings
are generated in the swift proxy log indicating that the
read_affinity is not being respected. When read_affinity is specified
this change sets the sorting_method to affinity automatically, and
otherwise uses a configured value which defaults to shuffle.

Note that write_affinity does not respect sorting_method and follows
a different code path and does not issue warnings in logs when used
without sorting_method.

Closes-bug: 1480581
Co-Authored-By: Andy McCrae <andy.mccrae@gmail.com>
Change-Id: I3cab89c95f288b4a59f4dd3c7360daca7a4f47bf
2015-09-03 05:46:56 +00:00
Steve Lewis
e230b449b5 Ensure rsync restarts fully during swift setup
Existing rsync stop/start handlers were relying on the pattern
parameter to the Ansible service module which relies on the results
of ps to determine if the service is running. This is unnecessary
because the rsync service script is well-behaved and responds
appropriately to start stop and restart commands. Removal of the
pattern param ensures that the response from the service command is
used instead.

Root cause of the bug is that when Keystone was changed to share
fernet secrets via rsync over ssh tunnel, an rsync process was
introduced in AIOs, Swift stand-alones, and other deployment
configurations that contain Keystone containers on the storage hosts.

The resulting rsync processes within Keystone containers pollute the
results of ps commands on the host, fooling Ansible into thinking
that an rsync service is running on the standard port when it is not.

Secondly, the handler responsible for stopping rsync was not causing
the notice for "Ensure rsync service running" to trigger cleanly in
my testing, so the tasks were changed to trigger both notices in an
ordered list.

Change-Id: I5ed47f7c1974d6b22eeb2ff5816ee6fa30ee9309
Closes-Bug: 1481121
2015-09-03 05:45:50 +00:00
Jesse Pretorius
8350d9ed5a Remove unused variables in os_swift role
swift_service_admin_username and swift_service_admin_tenant_name
are not used anywhere. The correct (and used) variables for the
purpose are swift_service_user_name and swift_service_project_name

Change-Id: I26cbbb77ddbf46fa64d8d34e5625590f3f66c515
Closes-Bug: #1460497
2015-08-15 08:36:49 +00:00
Jenkins
06480321dd Merge "Add swift-sync role and environment" 2015-08-07 21:33:44 +00:00
Andy McCrae
8fc0c9a8b4 Add swift-sync role and environment
Add the swift-remote host group and environment file.

Add an os_swift_sync role which will sync the swift ring and ssh keys
for swift hosts (remote and not-remote). Which has the following:
 * Moves the key and ring tasks out of os_swift role to os_swift_sync.
 * This adds the use of the "-r" flag that was added to the
   swift_rings.py and swift_rings_check.py.
 * Adds a ring.builder vs contents file consistency check.
 * Adjusts the rsync process to use the built-in synchronize module
 * Ensure services have started post ring/ssh key sync.

Adds environment file and sample configuration file for swift-remote
hosts (conf.d).

Move appropriate default vars to the os_swift_sync role, and remove them
from the os_swift role.

Rename the "os-swift-install.yml" playbook to "os-swift-setup.yml" as
this handles only the setup, and add a playbook to for both
os-swift-sync.yml and an overarching playbook (os-swift-install.yml)
that will call both the os-swift-sync.yml and os-swift-setup.yml
playbooks. This means the funcitonality of "os-swift-install.yml"
remains unchanged.

Adjust the run-playbooks.sh so that it calls the new overarching swift
playbook.

Change-Id: Ie2d8041b4bc46f092a96882fe3ca430be92195ed
Partially-Implements: blueprint multi-region-swift
2015-08-07 08:45:18 +00:00