From a68f804d683ec7cad718da08dd42a24840be50eb Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 5 Jan 2017 14:44:48 +0000 Subject: [PATCH] [Docs] Clarify Tags rules We had an ansible style guide, but we didn't speak about how to use tags. This should clarify tag usage. Change-Id: Ie34d70a85abf81744ffee34a6318c5f336531694 --- doc/source/developer-docs/contribute.rst | 28 +++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/doc/source/developer-docs/contribute.rst b/doc/source/developer-docs/contribute.rst index bab72bbe1c..3330276b26 100644 --- a/doc/source/developer-docs/contribute.rst +++ b/doc/source/developer-docs/contribute.rst @@ -254,6 +254,9 @@ submitted with patches: Ansible Style Guide ~~~~~~~~~~~~~~~~~~~ +YAML formatting +--------------- + When creating tasks and other roles for use in Ansible please create them using the YAML dictionary format. @@ -290,6 +293,29 @@ Example what **NOT** to do: Usage of the ">" and "|" operators should be limited to Ansible conditionals and command modules such as the Ansible ``shell`` or ``command``. +Tags and tags conventions +------------------------- + +Tags are assigned based on the relevance of each individual item. +Higher level includes (for example in the ``tasks/main.yml``) need high +level tags. For example, ``*-config`` or ``*-install``. +Included tasks can have more detailed tags. + +The following convention is used: + +* A tag including the word ``install`` handles software installation tasks. + Running a playbook with ``--tags -install`` only deploys the + necessary software on the target, and will not configure it to your + needs or run any service. + +* A tag including the word ``config`` prepares the configuration of the + software (adapted to your needs), and all the components necessary + to run the service(s) configured in the role. Running a playbook with + ``--tags -config`` is only possible if the target already ran + the tags ``-install``. + +* A tag including the word ``upgrade`` handles all the upgrade tasks. + Development cycle checklist ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -302,7 +328,7 @@ development team by performing one of the following recurring tasks: * By milestone 2: - * Handle deprecations from upstream projects's previous cycle + * Handle deprecations from upstream project's previous cycle * Handle OpenStack-Ansible roles deprecations from the previous cycle