From 1939f3e8ec723c40a1a3224a0e91c3d52d3921a6 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 22 Aug 2018 15:34:25 +1000 Subject: [PATCH] Move exim role to top-level Move the exim role to be a "generic" role in the top-level roles/ directory, making it available for use as a Zuul role. Update the linters jobs to look for roles in the top level Update the Role documentation to explain what the split in roles is about. Change-Id: I6b49d2a4b120141b3c99f5f1e28c410da12d9dc3 --- doc/source/roles.rst | 20 +++++++++++++++++++ {playbooks/roles => roles}/exim/README.rst | 0 .../roles => roles}/exim/defaults/main.yaml | 0 .../roles => roles}/exim/handlers/main.yaml | 0 .../roles => roles}/exim/tasks/RedHat.yaml | 0 .../roles => roles}/exim/tasks/default.yaml | 0 .../roles => roles}/exim/tasks/main.yaml | 0 .../roles => roles}/exim/templates/aliases.j2 | 0 .../exim/templates/exim.sysconfig.j2 | 0 .../exim/templates/exim4.conf.j2 | 0 .../exim/templates/exim4.default.j2 | 0 .../roles => roles}/exim/vars/Debian.yaml | 0 .../roles => roles}/exim/vars/RedHat.yaml | 0 tox.ini | 4 ++-- 14 files changed, 22 insertions(+), 2 deletions(-) rename {playbooks/roles => roles}/exim/README.rst (100%) rename {playbooks/roles => roles}/exim/defaults/main.yaml (100%) rename {playbooks/roles => roles}/exim/handlers/main.yaml (100%) rename {playbooks/roles => roles}/exim/tasks/RedHat.yaml (100%) rename {playbooks/roles => roles}/exim/tasks/default.yaml (100%) rename {playbooks/roles => roles}/exim/tasks/main.yaml (100%) rename {playbooks/roles => roles}/exim/templates/aliases.j2 (100%) rename {playbooks/roles => roles}/exim/templates/exim.sysconfig.j2 (100%) rename {playbooks/roles => roles}/exim/templates/exim4.conf.j2 (100%) rename {playbooks/roles => roles}/exim/templates/exim4.default.j2 (100%) rename {playbooks/roles => roles}/exim/vars/Debian.yaml (100%) rename {playbooks/roles => roles}/exim/vars/RedHat.yaml (100%) diff --git a/doc/source/roles.rst b/doc/source/roles.rst index d7e0d4ee37..a01501172c 100644 --- a/doc/source/roles.rst +++ b/doc/source/roles.rst @@ -5,4 +5,24 @@ Ansible Roles Documentation for roles included in `system-config` +There are two types of roles. Top-level roles, kept in the ``roles/`` +directory, are available to be used as roles in Zuul jobs. This +places some constraints on the roles, such as not being able to use +plugins. Add + +.. code-block:: yaml + + roles: + - zuul: openstack-infra/system-config + +to your job definition to source these roles. + +Roles in ``playbooks/roles`` are designed to be run on the +Infrastructure control-plane (i.e. from ``bridge.openstack.org``). +These roles are not available to be shared with Zuul jobs. + +Role documentation +------------------ + + .. zuul:autoroles:: diff --git a/playbooks/roles/exim/README.rst b/roles/exim/README.rst similarity index 100% rename from playbooks/roles/exim/README.rst rename to roles/exim/README.rst diff --git a/playbooks/roles/exim/defaults/main.yaml b/roles/exim/defaults/main.yaml similarity index 100% rename from playbooks/roles/exim/defaults/main.yaml rename to roles/exim/defaults/main.yaml diff --git a/playbooks/roles/exim/handlers/main.yaml b/roles/exim/handlers/main.yaml similarity index 100% rename from playbooks/roles/exim/handlers/main.yaml rename to roles/exim/handlers/main.yaml diff --git a/playbooks/roles/exim/tasks/RedHat.yaml b/roles/exim/tasks/RedHat.yaml similarity index 100% rename from playbooks/roles/exim/tasks/RedHat.yaml rename to roles/exim/tasks/RedHat.yaml diff --git a/playbooks/roles/exim/tasks/default.yaml b/roles/exim/tasks/default.yaml similarity index 100% rename from playbooks/roles/exim/tasks/default.yaml rename to roles/exim/tasks/default.yaml diff --git a/playbooks/roles/exim/tasks/main.yaml b/roles/exim/tasks/main.yaml similarity index 100% rename from playbooks/roles/exim/tasks/main.yaml rename to roles/exim/tasks/main.yaml diff --git a/playbooks/roles/exim/templates/aliases.j2 b/roles/exim/templates/aliases.j2 similarity index 100% rename from playbooks/roles/exim/templates/aliases.j2 rename to roles/exim/templates/aliases.j2 diff --git a/playbooks/roles/exim/templates/exim.sysconfig.j2 b/roles/exim/templates/exim.sysconfig.j2 similarity index 100% rename from playbooks/roles/exim/templates/exim.sysconfig.j2 rename to roles/exim/templates/exim.sysconfig.j2 diff --git a/playbooks/roles/exim/templates/exim4.conf.j2 b/roles/exim/templates/exim4.conf.j2 similarity index 100% rename from playbooks/roles/exim/templates/exim4.conf.j2 rename to roles/exim/templates/exim4.conf.j2 diff --git a/playbooks/roles/exim/templates/exim4.default.j2 b/roles/exim/templates/exim4.default.j2 similarity index 100% rename from playbooks/roles/exim/templates/exim4.default.j2 rename to roles/exim/templates/exim4.default.j2 diff --git a/playbooks/roles/exim/vars/Debian.yaml b/roles/exim/vars/Debian.yaml similarity index 100% rename from playbooks/roles/exim/vars/Debian.yaml rename to roles/exim/vars/Debian.yaml diff --git a/playbooks/roles/exim/vars/RedHat.yaml b/roles/exim/vars/RedHat.yaml similarity index 100% rename from playbooks/roles/exim/vars/RedHat.yaml rename to roles/exim/vars/RedHat.yaml diff --git a/tox.ini b/tox.ini index d3511bc5df..b46044e620 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ deps = -r{toxinidir}/test-requirements.txt [testenv:linters] whitelist_externals = bash commands = - bash -c "find playbooks/roles -maxdepth 1 -mindepth 1 -type d -print0 | \ + bash -c "find roles/ playbooks/roles -maxdepth 1 -mindepth 1 -type d -print0 | \ xargs -t -n1 -0 {toxinidir}/tools/check_readme.sh" flake8 {toxinidir}/tools/run-bashate.sh @@ -20,7 +20,7 @@ commands = python3 {toxinidir}/tools/irc_checks.py python3 {toxinidir}/tools/check_clouds_yaml.py # Ansible Lint Check - bash -c "find playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \ + bash -c "find roles playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \ ansible-lint -x ANSIBLE0004 -x ANSIBLE0006 -x ANSIBLE0007 -x ANSIBLE0011 \ -x ANSIBLE0012 -x ANSIBLE0013 -x ANSIBLE0015"