Browse Source

Stein fixes

- Cookstyle fixes
- Remove rubocop_todo.yml as it's no longer needed
- Update documentation
- Update delivery configuration to exclude integration cookbooks

Depends-On: https://review.opendev.org/701027
Depends-On: https://review.opendev.org/706101
Change-Id: I470c9240b5ab88971f2f8291b4ec371d6648ff66
changes/47/706147/4
Lance Albertson 2 years ago
parent
commit
aeb030b124
  1. 10
      .delivery/project.toml
  2. 16
      .rubocop.yml
  3. 19
      .rubocop_todo.yml
  4. 34
      README.rst
  5. 7
      attributes/default.rb
  6. 8
      metadata.rb
  7. 26
      recipes/rabbitmq-server.rb

10
.delivery/project.toml

@ -1 +1,9 @@
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
[local_phases]
unit = 'rspec spec/'
lint = 'cookstyle --display-cop-names --extra-details'
syntax = "berks install -e integration"
provision = "echo skipping"
deploy = "echo skipping"
smoke = "echo skipping"
functional = "echo skipping"
cleanup = "echo skipping"

16
.rubocop.yml

@ -1,5 +1,3 @@
inherit_from: .rubocop_todo.yml
AllCops:
Include:
- metadata.rb
@ -14,17 +12,3 @@ AllCops:
- .cookbooks/**/*
- berks-cookbooks/**/*
- .bundle/**/*
Encoding:
Exclude:
- metadata.rb
- Gemfile
NumericLiterals:
Enabled: false
LineLength:
Enabled: false
WordArray:
MinSize: 3

19
.rubocop_todo.yml

@ -1,19 +0,0 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-08-03 05:26:08 -0700 using RuboCop version 0.55.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'attributes/default.rb'
# Offense count: 18
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 116

34
README.rst

@ -18,9 +18,9 @@ and will soon other queues.
Requirements
============
- Chef 14 or higher
- chefdk 3.2.30 for testing (also includes berkshelf for cookbook
dependency resolution)
- Chef 15 or higher
- Chef Workstation 0.15.18 for testing (also includes berkshelf for
cookbook dependency resolution)
Platforms
=========
@ -34,7 +34,7 @@ Cookbooks
The following cookbooks are dependencies:
- 'openstack-common', '>= 18.0.0'
- 'openstack-common', '>= 19.0.0'
- 'rabbitmq', '~> 5.7'
Usage
@ -126,19 +126,19 @@ License and Author
| **Author** | Lance Albertson (lance@osuosl.org) |
+-----------------+-------------------------------------------+
+-----------------+---------------------------------------------+
| **Copyright** | Copyright (c) 2013, Opscode, Inc. |
+-----------------+---------------------------------------------+
| **Copyright** | Copyright (c) 2013, Craig Tracey |
+-----------------+---------------------------------------------+
| **Copyright** | Copyright (c) 2013, AT&T Services, Inc. |
+-----------------+---------------------------------------------+
| **Copyright** | Copyright (c) 2013, SUSE Linux GmbH. |
+-----------------+---------------------------------------------+
| **Copyright** | Copyright (c) 2013-2014, IBM Corp. |
+-----------------+---------------------------------------------+
| **Copyright** | Copyright (c) 2019, Oregon State University |
+-----------------+---------------------------------------------+
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013, Opscode, Inc. |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013, Craig Tracey |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013, AT&T Services, Inc. |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013, SUSE Linux GmbH. |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013-2014, IBM Corp. |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2019-2020, Oregon State University |
+-----------------+--------------------------------------------------+
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

7
attributes/default.rb

@ -1,10 +1,11 @@
# encoding: UTF-8
#
# Cookbook Name:: openstack-ops-messaging
# Cookbook:: openstack-ops-messaging
# Recipe:: default
#
# Copyright 2013, AT&T Services, Inc.
# Copyright 2013, Opscode, Inc.
# Copyright:: 2013, AT&T Services, Inc.
# Copyright:: 2013, Opscode, Inc.
# Copyright:: 2019, Oregon State University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

8
metadata.rb

@ -3,17 +3,15 @@ maintainer 'openstack-chef'
maintainer_email 'openstack-discuss@lists.openstack.org'
license 'Apache-2.0'
description 'Provides the shared messaging configuration for Chef for OpenStack.'
version '18.0.0'
recipe 'rabbitmq-server', 'Installs and configures RabbitMQ and is called via the server recipe'
version '19.0.0'
%w(ubuntu redhat centos).each do |os|
supports os
end
depends 'openstack-common', '>= 18.0.0'
depends 'openstack-common', '>= 19.0.0'
depends 'rabbitmq', '~> 5.7'
issues_url 'https://launchpad.net/openstack-chef'
source_url 'https://opendev.org/openstack/cookbook-openstack-ops-messaging'
chef_version '>= 14.0'
chef_version '>= 15.0'

26
recipes/rabbitmq-server.rb

@ -1,11 +1,11 @@
# encoding: UTF-8
#
# Cookbook Name:: openstack-ops-messaging
# Cookbook:: openstack-ops-messaging
# Recipe:: rabbitmq-server
#
# Copyright 2013, Opscode, Inc.
# Copyright 2013, AT&T Services, Inc.
# Copyright 2013, Craig Tracey <craigtracey@gmail.com>
# Copyright:: 2013, Opscode, Inc.
# Copyright:: 2013, AT&T Services, Inc.
# Copyright:: 2013, Craig Tracey <craigtracey@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
@ -32,27 +32,27 @@ bind_mq = bind_mq
bind_mq_address = bind_address bind_mq
# Used by OpenStack#rabbit_servers/#rabbit_server
node.normal['openstack']['mq']['listen'] = bind_mq_address
node.default['openstack']['mq']['listen'] = bind_mq_address
if node['openstack']['mq']['rabbitmq']['use_ssl']
if node['rabbitmq']['ssl_port'] != bind_mq['port']
node.normal['rabbitmq']['ssl_port'] = bind_mq['port']
node.default['rabbitmq']['ssl_port'] = bind_mq['port']
else
Chef::Log.error "Unable to listen on the port #{bind_mq['port']} for RabbitMQ TCP, which is listened on by SSL!"
end
else
node.normal['rabbitmq']['port'] = bind_mq['port']
node.default['rabbitmq']['port'] = bind_mq['port']
end
node.normal['rabbitmq']['address'] = bind_mq_address
node.normal['rabbitmq']['nodename'] = "#{user}@#{node['hostname']}"
node.default['rabbitmq']['address'] = bind_mq_address
node.default['rabbitmq']['nodename'] = "#{user}@#{node['hostname']}"
# Clustering
if node['openstack']['mq']['cluster']
node.normal['rabbitmq']['clustering']['enable'] = node['openstack']['mq']['cluster']
node.normal['rabbitmq']['erlang_cookie'] = get_password 'service', 'rabbit_cookie'
node.default['rabbitmq']['clustering']['enable'] = node['openstack']['mq']['cluster']
node.default['rabbitmq']['erlang_cookie'] = get_password 'service', 'rabbit_cookie'
if node['openstack']['mq']['search_for_cluster_disk_nodes']
qs = "recipes:openstack-ops-messaging\\:\\:rabbitmq-server AND chef_environment:#{node.chef_environment}"
node.normal['rabbitmq']['clustering']['use_auto_clustering'] = true
node.normal['rabbitmq']['clustering']['cluster_nodes'] =
node.default['rabbitmq']['clustering']['use_auto_clustering'] = true
node.default['rabbitmq']['clustering']['cluster_nodes'] =
search(:node, qs).sort_by { |n| n['hostname'] }.map do |n|
{ name: "#{user}@#{n['hostname']}" }
end

Loading…
Cancel
Save