Skip to content

Commit

Permalink
Syncing main to remove master (#22)
Browse files Browse the repository at this point in the history
* updating supported OS versions

* Keep working on tests

And refactor all the things

* Ensure molecule verifier passes

* Add GitHub contribution guidelines

* updating keys and repos for NAP

* adding back nginx plus signing key

* updating repo URL

* removing changelog, as there is not one

* Bring docs up to speed with other NGINX roles

And move some default variables into the vars subfolder

Co-authored-by: Alessandro Fael Garcia <[email protected]>
  • Loading branch information
aknot242 and alessfg authored Sep 14, 2020
1 parent 3bda56c commit 3cb5d6a
Show file tree
Hide file tree
Showing 52 changed files with 687 additions and 836 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
skip_list:
- '106'
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior:
1. Deploy NGINX App Protect role using playbook.yml
2. View output/logs/configuration on '...'
3. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Your environment:**
- Version of the NGINX App Protect role or specific commit
- Version of Ansible
- Target deployment platform

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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 using one of the [supported keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-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-app-protect/blob/main/CONTRIBUTING.md) document
- [ ] I have added Molecule tests that prove my fix is effective or that my feature works
- [ ] I have checked that all Molecule tests pass after adding my changes
- [ ] I have updated any relevant documentation (`defaults/main.yml`, `README.md` and `CHANGELOG.md`)
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@ default.pem

# Scratch Directory
scratch/

# nginx keys
sample-playbook/license/nginx-repo.*
42 changes: 18 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false

# Install ansible
addons:
apt:
packages:
- python-pip

services: docker
jobs:
include:
- name: "Lint role"
env:
scenario: default
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
install:
# Install ansible
- pip install ansible

# Check ansible version
- ansible --version

# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg

- pip install ansible==2.9.13
- pip install ansible-lint==4.3.4
- pip install yamllint==1.24.2
- pip install molecule==3.0.8
- pip install docker==4.3.1
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check

- travis_wait 50 molecule lint -s $scenario
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
20 changes: 0 additions & 20 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# Based on ansible-lint config
extends: default

rules:
Expand All @@ -9,25 +8,6 @@ rules:
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Changelog

## 0.2.0 (September 10, 2020)

BREAKING CHANGES:

* All of the variables have been updated to prevent naming collisions when using other roles. Please see README.MD for new variable names.
* Example playbook has been removed by collection authors in favor of using the Molecule configuration as a 'known-working' implementation.

ENHANCEMENTS:

* Huge refactoring by @alessfg to better unify this role with the structures present in the other nginxinc Ansible roles.
* Update Ansible to 2.9.13 and Ansible Lint to 4.3.4.
* Explicitly defined mode in relevant tasks for breaking changes in Ansible.
* Role refactored to separate install and configure operations in preparation for an upcoming role split.

FEATURES:

* Molecule 3 testing foundation is in the project, and linting is being performed by TravisCI. Now time to write tests!

BUG FIXES:

* The CentOS, RHEL, Debian and Ubuntu repositories have slightly changed to respond to a NAP repository deprecation activity. You may run into some duplication issues when running the role on a preexisting target that already has had NGINX installed using the role. To fix this, manually remove the old repository source.
* The RHEL and CentOS repository setups were incorrectly using a static gpgkey instead of using the variable as a source.

## 0.1.0 (September 9, 2020)

Supports App Protect 2.0, which brings a number of features including support for Ubuntu 18.04.

Release notes for NGINX App Protect 2.0: docs.nginx.com/nginx-app-protect/releases/#release-2-0
38 changes: 19 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ The following is a set of guidelines for contributing to the NGINX App Protect A
* [Git Guidelines](#git-guidelines)
* [Ansible Guidelines](#ansible-guidelines)

[Code of Conduct](CODE_OF_CONDUCT.md)
[Code of Conduct](https://github.com/nginxinc/ansible-role-nginx-app-protect/blob/main/CODE_OF_CONDUCT.md)

## Ask a Question

Please open an Issue on GitHub with the label `question`.
Don't know how something works? Curious if the role can achieve your desired functionality? Please open an Issue on GitHub with the label `question`.

## Getting Started

Follow our [Installation Guide](README.md#Installation) to install Ansible and Molecule and get ready to use the NGINX App Protect Ansible role.
Follow our [Installation Guide](https://github.com/nginxinc/ansible-role-nginx-app-protect/blob/main/README.md#Installation) to install Ansible and Molecule and get ready to use the NGINX Ansible role.

### Project Structure

* The NGINX App Protect Ansible role is written in `yaml` and supports open source NGINX Plus.
* The NGINX Ansible role is written in `yaml` and supports NGINX App Protect.
* 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/`
* The main code is found in `tasks/`
* The main variables can be found in `defaults/main.yml`
* Configuration templates for NGINX Plus and NGINX App Protect can be found in `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/`
* CI/CD is done via Travis using `.travis.yml` deployment yaml files

## Contributing

Expand All @@ -46,27 +46,27 @@ To suggest an enhancement, please create an issue on GitHub with the label `enha

### 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-app-protect/blob/master/.github/PULL_REQUEST_TEMPLATE.md)
* Fork the repo, create a branch, submit a PR when your changes are **tested** (ideally using Molecule) and ready for review
* Fill in [our pull request template](https://github.com/nginxinc/ansible-role-nginx-app-protect/blob/main/.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

### 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 before you submit a PR to catch any potential 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>

### 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 summarized in the next few points
* 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>
Loading

0 comments on commit 3cb5d6a

Please sign in to comment.