Improve documentation (#206)
* Create CONTRIBUTING.md * Add PR template * Tweak .yamllint * Update README playbook examples
This commit is contained in:
parent
36ba93a5d7
commit
b5baf3a2ae
10
.github/pull_request_template.md
vendored
Normal file
10
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
### Proposed changes
|
||||||
|
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue here in this description (not in the title of the PR).
|
||||||
|
|
||||||
|
### Checklist
|
||||||
|
Before creating a PR, run through this checklist and mark each as complete.
|
||||||
|
|
||||||
|
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx/blob/master/CONTRIBUTING.md) document
|
||||||
|
- [ ] I have added Molecule tests that prove my fix is effective or that my feature works
|
||||||
|
- [ ] I have checked that all unit tests pass after adding my changes
|
||||||
|
- [ ] If required, I have updated necessary documentation (`defaults/main/` and `README.md`)
|
@ -7,7 +7,6 @@ rules:
|
|||||||
brackets:
|
brackets:
|
||||||
max-spaces-inside: 1
|
max-spaces-inside: 1
|
||||||
level: error
|
level: error
|
||||||
comments: disable
|
|
||||||
comments-indentation: disable
|
comments-indentation: disable
|
||||||
line-length: disable
|
line-length: disable
|
||||||
truthy: disable
|
truthy: disable
|
||||||
|
72
CONTRIBUTING.md
Normal file
72
CONTRIBUTING.md
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
# Contributing Guidelines
|
||||||
|
|
||||||
|
The following is a set of guidelines for contributing to the NGINX Ansible role. We really appreciate that you are considering contributing!
|
||||||
|
|
||||||
|
#### Table Of Contents
|
||||||
|
|
||||||
|
[Ask a Question](#ask-a-question)
|
||||||
|
|
||||||
|
[Getting Started](#getting-started)
|
||||||
|
|
||||||
|
[Contributing](#contributing)
|
||||||
|
|
||||||
|
[Code Guidelines](#code-guidelines)
|
||||||
|
* [Git Guidelines](#git-guidelines)
|
||||||
|
* [Ansible Guidelines](#ansible-guidelines)
|
||||||
|
|
||||||
|
[Code of Conduct](https://github.com/nginxinc/ansible-role-nginx/blob/master/CODE_OF_CONDUCT.md)
|
||||||
|
|
||||||
|
## Ask a Question
|
||||||
|
|
||||||
|
Please open an Issue on GitHub with the label `question`.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Follow our [Installation Guide](https://github.com/nginxinc/ansible-role-nginx/blob/master/README.md#Installation) to install Ansible and Molecule and get ready to use the NGINX Ansible role.
|
||||||
|
|
||||||
|
### Project Structure
|
||||||
|
|
||||||
|
* The NGINX Ansible role is written in `yaml` and supports open source NGINX, NGINX Plus, NGINX Amplify, NGINX Controller, and NGINX Unit.
|
||||||
|
* The project follows the standard [Ansible role directory structure](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html)
|
||||||
|
* The main code is found at `tasks/`
|
||||||
|
* The main variables can be found at `defaults/main/`
|
||||||
|
* Configuration templates for NGINX can be found at `templates/`
|
||||||
|
* [Molecule](https://molecule.readthedocs.io/) tests can be found in `molecule/`.
|
||||||
|
* CI/CD is done via Travis using `.travis.yml` Deployment yaml files, and Helm files are found at `deployments/`
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
### Report a Bug
|
||||||
|
|
||||||
|
To report a bug, open an issue on GitHub with the label `bug` using the available bug report issue template. Please ensure the issue has not already been reported.
|
||||||
|
|
||||||
|
### Suggest an Enhancement
|
||||||
|
|
||||||
|
To suggest an enhancement, please create an issue on GitHub with the label `enhancement` using the available feature issue template.
|
||||||
|
|
||||||
|
### Open a Pull Request
|
||||||
|
|
||||||
|
* Fork the repo, create a branch, submit a PR when your changes are tested and ready for review
|
||||||
|
* Fill in [our pull request template](https://github.com/nginxinc/ansible-role-nginx/blob/master/.github/PULL_REQUEST_TEMPLATE.md)
|
||||||
|
|
||||||
|
Note: if you’d like to implement a new feature, please consider creating a feature request issue first to start a discussion about the feature.
|
||||||
|
|
||||||
|
## Code Guidelines
|
||||||
|
|
||||||
|
### Git Guidelines
|
||||||
|
|
||||||
|
* Keep a clean, concise and meaningful git commit history on your branch (within reason), rebasing locally and squashing before submitting a PR
|
||||||
|
* Follow the guidelines of writing a good commit message as described here <https://chris.beams.io/posts/git-commit/> and summarised in the next few points
|
||||||
|
* In the subject line, use the present tense ("Add feature" not "Added feature")
|
||||||
|
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
||||||
|
* Limit the subject line to 72 characters or less
|
||||||
|
* Reference issues and pull requests liberally after the subject line
|
||||||
|
* Add more detailed description in the body of the git message (`git commit -a` to give you more space and time in your text editor to write a good message instead of `git commit -am`)
|
||||||
|
|
||||||
|
### Ansible Guidelines
|
||||||
|
|
||||||
|
* Run `molecule lint` over your code to automatically resolve a lot of `yaml` and Ansible style issues.
|
||||||
|
* Run `molecule test --all` on your code to catch any other issues.
|
||||||
|
* Follow these guides on some good practices for Ansible:
|
||||||
|
* <https://www.ansible.com/blog/ansible-best-practices-essentials>
|
||||||
|
* <https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html>
|
29
README.md
29
README.md
@ -13,14 +13,29 @@ Requirements
|
|||||||
|
|
||||||
**Ansible**
|
**Ansible**
|
||||||
|
|
||||||
This role was developed and tested with [maintained](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status) versions of
|
This role was developed and tested with [maintained](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status) versions of Ansible. Backwards compatibility is not guaranteed.
|
||||||
Ansible. Backwards compatibility is not guaranteed.
|
|
||||||
|
Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
|
||||||
|
|
||||||
|
**Molecule**
|
||||||
|
|
||||||
|
Molecule is used to test the various functionailities of the role. Instructions on how to install Molecule can be found in the [Molecule website](https://molecule.readthedocs.io/en/stable/installation.html).
|
||||||
|
|
||||||
|
Installation
|
||||||
|
------------
|
||||||
|
|
||||||
**Ansible Galaxy**
|
**Ansible Galaxy**
|
||||||
|
|
||||||
Use `ansible-galaxy install nginxinc.nginx` to install the role on your system.
|
Use `ansible-galaxy install nginxinc.nginx` to install the latest stable release of the role on your system.
|
||||||
|
|
||||||
It supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html#mainline) and [NGINX Plus](https://www.nginx.com/products/technical-specs/):
|
**Git**
|
||||||
|
|
||||||
|
Use `git clone https://github.com/nginxinc/ansible-role-nginx.git` to pull the latest edge commit of the role from GitHub.
|
||||||
|
|
||||||
|
Platforms
|
||||||
|
---------
|
||||||
|
|
||||||
|
The NGINX Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html#mainline), [NGINX Plus](https://www.nginx.com/products/technical-specs/), the [NGINX Amplify agent](https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-faq.md#21-what-operating-systems-are-supported), the [NGINX Controller agent](https://docs.nginx.com/nginx-controller/technical-specs/#nginx-controller-agent-technical-specifications), and [NGINX Unit](https://unit.nginx.org/installation/#official-packages):
|
||||||
|
|
||||||
**NGINX Open Source**
|
**NGINX Open Source**
|
||||||
|
|
||||||
@ -120,7 +135,6 @@ Debian:
|
|||||||
- stretch
|
- stretch
|
||||||
Ubuntu:
|
Ubuntu:
|
||||||
versions:
|
versions:
|
||||||
- trusty
|
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
RedHat:
|
RedHat:
|
||||||
@ -245,6 +259,11 @@ This is a sample playbook file for deploying the Ansible Galaxy NGINX role in a
|
|||||||
template_file: http/default.conf.j2
|
template_file: http/default.conf.j2
|
||||||
conf_file_name: default.conf
|
conf_file_name: default.conf
|
||||||
conf_file_location: /etc/nginx/conf.d/
|
conf_file_location: /etc/nginx/conf.d/
|
||||||
|
servers:
|
||||||
|
server1:
|
||||||
|
listen:
|
||||||
|
listen_localhost:
|
||||||
|
# ip: 0.0.0.0
|
||||||
port: 80
|
port: 80
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
error_page: /usr/share/nginx/html
|
error_page: /usr/share/nginx/html
|
||||||
|
Loading…
Reference in New Issue
Block a user