From 1269d327cd760d24b4a3bd7bd9c34c1d326ae8d4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 14 Jun 2018 19:17:52 +0200 Subject: [PATCH] Introduce base Zuul jobs Now that the zuul base jobs from infra have been merged, we can test the role as an independant entity. The first step is to get it pass lint tests, so all the other jobs as marked as non-voting. Change-Id: I00d6c066fea8ec70ae032010199d00f089005065 Co-Authored-By: Andrew Smith --- .gitreview | 3 +- defaults/main.yml | 2 + doc/requirements.txt | 10 + doc/source/conf.py | 328 ++++++++++++++++++++++++++++ doc/source/index.rst | 33 +++ releasenotes/source/conf.py | 285 ++++++++++++++++++++++++ releasenotes/source/index.rst | 6 + setup.cfg | 2 +- tasks/main.yml | 6 +- tasks/qdrouterd_install_apt.yml | 19 +- tasks/qdrouterd_install_yum.yml | 53 ++--- tasks/qdrouterd_pre_install.yml | 14 +- templates/qdrouterd.conf.j2 | 2 + templates/qdrouterd.json.j2 | 29 --- tests/test-install-qdrouterd.yml | 31 +++ tests/test-qdrouterd-functional.yml | 15 +- tests/test-vars.yml | 19 ++ tests/test.yml | 2 +- vars/ubuntu.yml | 10 +- zuul.d/project.yaml | 32 +++ 20 files changed, 830 insertions(+), 71 deletions(-) create mode 100644 doc/requirements.txt create mode 100644 doc/source/conf.py create mode 100644 doc/source/index.rst create mode 100644 releasenotes/source/conf.py create mode 100644 releasenotes/source/index.rst delete mode 100644 templates/qdrouterd.json.j2 create mode 100644 tests/test-install-qdrouterd.yml create mode 100644 tests/test-vars.yml create mode 100644 zuul.d/project.yaml diff --git a/.gitreview b/.gitreview index 865c2a9..e2d776a 100644 --- a/.gitreview +++ b/.gitreview @@ -1,4 +1,5 @@ [gerrit] host=review.openstack.org port=29418 -project=openstack/openstack-ansible.git +project=openstack/ansible-role-qdrouterd.git +defaultbranch=master diff --git a/defaults/main.yml b/defaults/main.yml index 1ef59eb..3ff7ecc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -35,6 +35,8 @@ qdrouterd_listener_auth_peer: "no" qdrouterd_listener_sasl_mech: "ANONYMOUS" qdrouterd_irl_addr: 0.0.0.0 qdrouterd_irl_port: 31460 +qdrouterd_irl_auth_peer: "no" +qdrouterd_irl_sasl_mech: "ANONYMOUS" qdrouterd_worker_threads: 4 qdrouterd_sasl_conf_path: "/etc/sasl2" qdrouterd_sasl_conf_file: "/etc/sasl2/qdrouterd.conf" diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..b3abbc3 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,10 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. + +# this is required for the docs build jobs +sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +openstackdocstheme>=1.18.1 # Apache-2.0 +reno>=2.5.0 # Apache-2.0 +sphinxmark>=0.1.14 # Apache-2.0 +doc8>=0.6.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 0000000..05ce8c9 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,328 @@ +#!/usr/bin/env python3 + +# 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. + +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import pbr.version +import os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'openstackdocstheme', + 'sphinx.ext.autodoc', + 'sphinxmark' +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +author = 'OpenStack-Ansible Contributors' +category = 'Miscellaneous' +copyright = '2014-2018, OpenStack-Ansible Contributors' +description = 'OpenStack-Ansible deploys OpenStack environments using Ansible.' +project = 'OpenStack-Ansible' +role_name = 'qdrouterd' +target_name = 'ansible-role' + role_name +title = 'OpenStack-Ansible Documentation: ' + role_name + 'role' + +# The link to the browsable source code (for the left hand menu) +oslosphinx_cgit_link = ( + 'https://git.openstack.org/cgit/openstack/{}'.format(target_name) +) + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version_info = pbr.version.VersionInfo(target_name) +# The full version, including alpha/beta/rc tags. +release = version_info.version_string_with_vcs() +# The short X.Y version. +version = version_info.canonical_version_string() + +# openstackdocstheme options +repository_name = 'openstack/' + target_name +bug_project = project.lower() +bug_tag = '' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'openstackdocs' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +html_last_updated_fmt = '%Y-%m-%d %H:%M' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = target_name + '-docs' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, target_name + '.tex', + title, author, 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, target_name, + title, [author], 1) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, target_name, + title, author, project, + description, category), +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +watermark = os.popen("git branch --contains $(git rev-parse HEAD)\ +| awk -F/ '/stable/ {print $2}'").read().strip(' \n\t').capitalize() +if watermark == "": + watermark = "Pre-release" + +# -- Options for sphinxmark ----------------------------------------------- +sphinxmark_enable = True +sphinxmark_div = 'docs-body' +sphinxmark_image = 'text' +sphinxmark_text = watermark +sphinxmark_text_color = (128, 128, 128) +sphinxmark_text_size = 70 diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 0000000..68b7ef8 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,33 @@ +=========================== +OpenStack-Ansible Qdrouterd +=========================== + +This Ansible role deploys Qdrouterd. When multiple hosts are present in +the ``qdrouterd_all`` inventory group, a router mesh is created. + +Table of Contents +~~~~~~~~~~~~~~~~~ + +.. toctree:: + :maxdepth: 2 + +To clone or view the source code for this repository, visit the role repository +for `qdrouterd `_. + +Default variables +~~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../defaults/main.yml + :language: yaml + :start-after: under the License. + +Dependencies +~~~~~~~~~~~~ + +This role needs pip >= 7.1 installed on the target host. + +Example playbook +~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../examples/playbook.yml + :language: yaml diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py new file mode 100644 index 0000000..028fb46 --- /dev/null +++ b/releasenotes/source/conf.py @@ -0,0 +1,285 @@ +#!/usr/bin/env python3 + +# 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. + +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'openstackdocstheme', + 'reno.sphinxext', +] + +# Add any paths that contain templates here, relative to this directory. +# templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +author = 'OpenStack-Ansible Contributors' +category = 'Miscellaneous' +copyright = '2014-2016, OpenStack-Ansible Contributors' +description = 'OpenStack-Ansible deploys OpenStack environments using Ansible.' +project = 'OpenStack-Ansible' +role_name = 'rabbitmq_server' +target_name = 'openstack-ansible-' + role_name +title = 'OpenStack-Ansible Release Notes: ' + role_name + 'role' + +# The link to the browsable source code (for the left hand menu) +oslosphinx_cgit_link = ( + 'https://git.openstack.org/cgit/openstack/{}'.format(target_name) +) + +# Release notes do not need a version number in the title, they +# cover multiple releases. +# The full version, including alpha/beta/rc tags. +release = '' +# The short X.Y version. +version = '' + +# openstackdocstheme options +repository_name = 'openstack/' + target_name +bug_project = project.lower() +bug_tag = '' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'openstackdocs' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +# html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +html_last_updated_fmt = '%Y-%m-%d %H:%M' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = target_name + '-docs' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # 'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, target_name + '.tex', + title, author, 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, target_name, + title, [author], 1) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, target_name, + title, author, project, + description, category), +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + +# -- Options for Internationalization output ------------------------------ +locale_dirs = ['locale/'] diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst new file mode 100644 index 0000000..c8dfa41 --- /dev/null +++ b/releasenotes/source/index.rst @@ -0,0 +1,6 @@ +================================ + OpenStack-Ansible Release Notes +================================ + +.. toctree:: + :maxdepth: 1 diff --git a/setup.cfg b/setup.cfg index 3949197..1b19590 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = ansible-qdrouterd +name = ansible-role-qdrouterd summary = qdrouterd for Ansible description-file = README.rst diff --git a/tasks/main.yml b/tasks/main.yml index d065e21..5c7042c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -26,6 +26,9 @@ - include: qdrouterd_pre_install.yml +- include: qdrouterd_install.yml + static: no + # Qdrouterd SSL/TLS listener configuration # # If the user has not specified a certificate, key and CA certificate, we will @@ -48,9 +51,6 @@ tags: - qdrouterd-config -- include: qdrouterd_install.yml - static: no - - include: qdrouterd_post_install.yml diff --git a/tasks/qdrouterd_install_apt.yml b/tasks/qdrouterd_install_apt.yml index 6a44471..009dd23 100644 --- a/tasks/qdrouterd_install_apt.yml +++ b/tasks/qdrouterd_install_apt.yml @@ -13,10 +13,27 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Add the qdrouterd via ppa + apt_key: + id: "{{ qdrouterd_ppa_keyid }}" + keyserver: "{{ qdrouterd_ppa_keyserver }}" + state: present + tags: + - qdrouterd-apt-keys + +- name: Setup qpid ppa repository + apt_repository: + repo: "{{ qdrouterd_ppa_repo }}" + update_cache: True + codename: xenial + state: present + tags: + - qdrouterd-rep + - name: Install Qpid Dispatch Router (qdrouterd) packages apt: name: "{{ qdrouterd_distro_packages }}" - state: "{{ qdrouterd_server_package_state }}" + state: "{{ qdrouterd_package_state }}" register: install_qdrouterd tags: - qdrouterd-apt-packages diff --git a/tasks/qdrouterd_install_yum.yml b/tasks/qdrouterd_install_yum.yml index 5bbb4eb..214e7e2 100644 --- a/tasks/qdrouterd_install_yum.yml +++ b/tasks/qdrouterd_install_yum.yml @@ -12,37 +12,38 @@ # 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: Check if EPEL repo is already configured. - stat: path={{ epel_repofile_path }} - register: epel_repofile_result - -- name: Install EPEL repo. - yum: - name: "{{ epel_repo_url }}" - state: present - register: result - when: not epel_repofile_result.stat.exists - -- name: Import EPEL GPG key - rpm_key: - key: "{{ epel_repo_gpg_key_url }}" - state: present - when: not epel_repofile_result.stat.exists - -- name: Ensure yum-config-manager is installed - package: - name: yum-utils - state: present - -- name: Ensure that EPEL is enabled - shell: yum-config-manager --enable epel +# +# TODO (ansmith): conditionally enable epel +# +#- name: Check if EPEL repo is already configured. +# stat: path={{ epel_repofile_path }} +# register: epel_repofile_result +# +#- name: Install EPEL repo. +# yum: +# name: "{{ epel_repo_url }}" +# state: present +# register: result +# when: not epel_repofile_result.stat.exists +# +#- name: Import EPEL GPG key +# rpm_key: +# key: "{{ epel_repo_gpg_key_url }}" +# state: present +# when: not epel_repofile_result.stat.exists +# +#- name: Ensure yum-config-manager is installed +# package: +# name: yum-utils +# state: present +# +#- name: Ensure that EPEL is enabled +# shell: yum-config-manager --enable epel - name: Install Qpid Dispatch Router (qdrouterd) packages yum: name: "{{ qdrouterd_distro_packages }}" state: "{{ qdrouterd_package_state }}" - enablerepo: epel register: install_qdrouterd tags: - qdrouterd-yum-packages diff --git a/tasks/qdrouterd_pre_install.yml b/tasks/qdrouterd_pre_install.yml index e6ac27c..229f230 100644 --- a/tasks/qdrouterd_pre_install.yml +++ b/tasks/qdrouterd_pre_install.yml @@ -12,8 +12,8 @@ # 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: Create the local directories + +- name: Create the local config directory file: path: "{{ qdrouterd_etc_conf_path }}" state: "directory" @@ -23,4 +23,14 @@ tags: - qdrouterd-config +- name: Create the config ssl directory + file: + path: "{{ qdrouterd_etc_conf_path }}/ssl" + state: "directory" + group: "root" + owner: "root" + mode: "0755" + tags: + - qdrouterd-config + diff --git a/templates/qdrouterd.conf.j2 b/templates/qdrouterd.conf.j2 index 870a771..590f6d9 100644 --- a/templates/qdrouterd.conf.j2 +++ b/templates/qdrouterd.conf.j2 @@ -37,6 +37,8 @@ listener { {% if qdrouterd_require_ssl == 'yes' %} sslProfile: {{ ansible_hostname }} {% endif %} + authenticatePeer: {{ qdrouterd_irl_auth_peer }} + saslMechanisms: {{ qdrouterd_irl_sasl_mech }} } {% endif %} diff --git a/templates/qdrouterd.json.j2 b/templates/qdrouterd.json.j2 deleted file mode 100644 index 193ec19..0000000 --- a/templates/qdrouterd.json.j2 +++ /dev/null @@ -1,29 +0,0 @@ -{ - "command": "/usr/sbin/qdrouterd", - "config_files": [ - { - "source": "{{ container_config_directory }}/qdrouterd.conf", - "dest": "/etc/qpid-dispatch/qdrouterd.conf", - "owner": "qdrouterd", - "perm": "0600" - }, - { - "source": "{{ container_config_directory }}/qdrouterd-sasl.conf", - "dest": "/etc/sasl2/qdrouterd.conf", - "owner": "qdrouterd", - "perm": "0600" - } - ], - "permissions": [ - { - "path": "/var/lib/qdrouterd", - "owner": "qdrouterd:qdrouterd", - "recurse": true - }, - { - "path": "/var/log/kolla/qdrouterd", - "owner": "qdrouterd:qdrouterd", - "recurse": true - } - ] -} diff --git a/tests/test-install-qdrouterd.yml b/tests/test-install-qdrouterd.yml new file mode 100644 index 0000000..7780dcb --- /dev/null +++ b/tests/test-install-qdrouterd.yml @@ -0,0 +1,31 @@ +--- +# Copyright 2018, Red Hat, 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: Gather facts + hosts: "qdrouterd_all" + user: root + gather_facts: true + +- name: Deploy Qdrouterd + hosts: qdrouterd_all + serial: 1 + user: root + become: true + gather_facts: true + any_errors_fatal: true + roles: + - role: "qdrouterd" + vars_files: + - test-vars.yml diff --git a/tests/test-qdrouterd-functional.yml b/tests/test-qdrouterd-functional.yml index f177552..d5f081d 100644 --- a/tests/test-qdrouterd-functional.yml +++ b/tests/test-qdrouterd-functional.yml @@ -41,7 +41,7 @@ - name: Open qdrouterd.conf slurp: - src: "{{ qdrouterd_etc_conf_file }}" + src: "{{ _qdrouterd_etc_conf_file }}" register: qdrouterd_config - name: Read qdrouterd_ssl_cert @@ -72,10 +72,19 @@ - name: Print qdrouterd_statistics debug: - var: qdrotuerd_statistics + var: qdrouterd_statistics + + - name: Get qdrouterd node view + command: "qdstat -nv -b 0.0.0.0:31459" + register: qdrouterd_nv + changed_when: false + + - name: Print qdrouterd_nv + debug: + var: qdrouterd_nv - name: Ensure SSL cert/key checksums are identical across the mesh assert: that: - - hostvars['container1']['qdrotuerd_ssl_cert_checksum'] == hostvars['container2']['qdrouterd_ssl_cert_checksum'] == hostvars['container3']['qdrouterd_ssl_cert_checksum'] + - hostvars['container1']['qdrouterd_ssl_cert_checksum'] == hostvars['container2']['qdrouterd_ssl_cert_checksum'] == hostvars['container3']['qdrouterd_ssl_cert_checksum'] - hostvars['container1']['qdrouterd_ssl_key_checksum'] == hostvars['container2']['qdrouterd_ssl_key_checksum'] == hostvars['container3']['qdrouterd_ssl_key_checksum'] diff --git a/tests/test-vars.yml b/tests/test-vars.yml new file mode 100644 index 0000000..f428910 --- /dev/null +++ b/tests/test-vars.yml @@ -0,0 +1,19 @@ +--- +# Copyright 2018, Red Hat, 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. + +qdrouterd_worker_threads: 2 +qdrouterd_require_ssl: no +qdrouterd_listener_port: 31459 +qdrouterd_irl_port: 31460 diff --git a/tests/test.yml b/tests/test.yml index 861f684..273ff88 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -17,7 +17,7 @@ - include: common/test-setup-host.yml # Install previous version qdrouterd server -- include: common/test-install-qdrouterd.yml +- include: test-install-qdrouterd.yml # Run functional tests - include: test-qdrouterd-functional.yml diff --git a/vars/ubuntu.yml b/vars/ubuntu.yml index 0201aed..da8fc64 100644 --- a/vars/ubuntu.yml +++ b/vars/ubuntu.yml @@ -15,15 +15,17 @@ qdrouterd_distro_packages: - python-qpid-proton + - libsasl2-modules - sasl2-bin - - libpython-2.2 - qdrouterd + - qdmanage + - qdstat -qdrouterd_package_name: "qdrouterd" +_qdrouterd_etc_conf_path: "/etc/qpid-dispatch" +_qdrouterd_etc_conf_file: "/etc/qpid-dispatch/qdrouterd.conf" qdrouterd_service_name: "qdrouterd" -qdrouterd_etc_conf_file: "/etc/qpid-dispatch/qdrouterd.conf" # repo details for qpid ppa qdrouterd_ppa_repo: "ppa:qpid/released" -qdrouterd_ppa_keyid: 4096R/4D8EB5FDA37AB55F41A135203BF88A0C6A770882 +qdrouterd_ppa_keyid: 6A770882 qdrouterd_ppa_keyserver: "keyserver.ubuntu.com" diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml new file mode 100644 index 0000000..ced4237 --- /dev/null +++ b/zuul.d/project.yaml @@ -0,0 +1,32 @@ +# Copyright 2018, SUSE LINUX GmbH. +# +# 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. + +- project: + check: + jobs: + - openstack-ansible-linters + - openstack-ansible-functional-centos-7: + voting: false + - openstack-ansible-functional-opensuse-423: + voting: false + - openstack-ansible-functional-ubuntu-xenial: + voting: false + - openstack-ansible-upgrade-ubuntu-xenial: + voting: false + experimental: + jobs: + - openstack-ansible-integrated-deploy-aio + gate: + jobs: + - openstack-ansible-linters