Skip to content
This repository has been archived by the owner on Apr 10, 2021. It is now read-only.

Add initial documentation conventions #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pcahyna
Copy link
Contributor

@pcahyna pcahyna commented Apr 15, 2020

@t-woerner
Copy link

t-woerner commented Apr 15, 2020

If people have several example playbooks, they might want to have a directory to place them into to have more clear structure. Instead of getting lots of differently named folder names, I would suggest to use the playbooks folder then as it is already documented for Ansible collections.

* Example playbooks are to live in the root directory, not in a separate subdirectory, and
prefixed with `example-` . Rationale: Ansible depends on particular structure, where
directory names have special meanings. If one introduces a new directory, anybody else
who looks at the code wonders whether it also has some special meaning.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collections have both a docs/ and a playbooks/ sub-directory: https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html#collection-structure
Why can't we use those in our role structure? Will it cause problems with ansible galaxy if the role on github has a non-standard directory? Will it cause problems with RPM packaging or using roles from an RPM package?

Or do we need a sub-directory hey-this-is-non-standard-stuff/ with docs/ and playbooks/ (and whatever else we want)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside of a role, there's no restriction on extra folders. I agree we should put them under a folder, and following the convention of a playbooks/ dir from Collections makes the most sense to me.

Alternatively, if you have a sample playbook, why not just make it into a Molecule scenario so we get testing around it? That's where I always look for sample playbooks in my own roles.

Copy link
Contributor

@richm richm Apr 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I suggest we change the standard to say something like this:

Example playbooks can live in the root directory, and will be prefixed with "example-". If there are many such playbooks that clutter the root directory, the directory "playbooks/" can be used for these playbooks. Rationale: Although there is no standard "playbooks/" directory for Ansible Roles, there is a need to organize playbooks in a separate folder, if there are many such playbooks (where "many" is in the judgement of the role maintainer). Ansible Collections defines a "playbooks/" sub-directory for Collections - https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html#collection-structure - Use this for Roles in the absence of any Roles specific standard for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this was proposed by @robled and the text summarizes the reasoning that led to it. We heard no objection at that time.

Concerning docs/ and playbooks/ in collections, which one is supposed to be used for examples then? The documentation does not even say that.

Alternatively, if you have a sample playbook, why not just make it into a Molecule scenario so we get testing around it? That's where I always look for sample playbooks in my own roles.

  • we are not using Molecule scenarios heavily
  • that's not a place where a user would look for examples
  • examples are often not suitable as tests - for example, they can contain invalid addresses, see "Use RFC 5737, 7042 and 3849 addresses in examples." in this very PR, and there will likely be other incompatibilities.

If an example is suitable as a test, we have a symlink in tests/ to it, which makes it usable both as an example and as a test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points have been made by the group with regards to this, and my previous opinion on this has changed. Given that Collections has given us some official guidance on other directories we can create that are becoming standard, I am in support of whatever Collections suggests, including docs/, playbooks/, etc...

* Example playbooks are to live in the root directory, not in a separate subdirectory, and
prefixed with `example-` . Rationale: Ansible depends on particular structure, where
directory names have special meanings. If one introduces a new directory, anybody else
who looks at the code wonders whether it also has some special meaning.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside of a role, there's no restriction on extra folders. I agree we should put them under a folder, and following the convention of a playbooks/ dir from Collections makes the most sense to me.

Alternatively, if you have a sample playbook, why not just make it into a Molecule scenario so we get testing around it? That's where I always look for sample playbooks in my own roles.

pcahyna added a commit to pcahyna/meta_standards that referenced this pull request Apr 24, 2020
This is the same change as in PR oasis-roles#17 minus the controversial part.
@richm
Copy link
Contributor

richm commented May 12, 2020

What do we want to do with this PR?

@pcahyna
Copy link
Contributor Author

pcahyna commented May 14, 2020

What do we want to do with this PR?

First of all, I would like to have the uncontroversial subset in #20 merged.

@richm
Copy link
Contributor

richm commented Jun 9, 2020

What do we want to do with this PR?

First of all, I would like to have the uncontroversial subset in #20 merged.

@pcahyna me too - this PR needs rebasing, so after that, I think we should commit as is, and follow-up with another PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants