diff --git a/.delivery/project.toml b/.delivery/project.toml index 6d5e361..4066e55 100644 --- a/.delivery/project.toml +++ b/.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" diff --git a/.rubocop.yml b/.rubocop.yml index 5e0be9f..8d19f13 100644 --- a/.rubocop.yml +++ b/.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 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index 80a53df..0000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -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 diff --git a/README.rst b/README.rst index 3ce89fd..f7831fc 100644 --- a/README.rst +++ b/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 diff --git a/attributes/default.rb b/attributes/default.rb index 0971181..82a84e7 100644 --- a/attributes/default.rb +++ b/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. diff --git a/metadata.rb b/metadata.rb index e98e838..07e7c50 100644 --- a/metadata.rb +++ b/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' diff --git a/recipes/rabbitmq-server.rb b/recipes/rabbitmq-server.rb index 70967ab..d700e28 100644 --- a/recipes/rabbitmq-server.rb +++ b/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 +# Copyright:: 2013, Opscode, Inc. +# Copyright:: 2013, AT&T Services, Inc. +# Copyright:: 2013, Craig Tracey # # 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