Skip to content

Commit 3cb5d6a

Browse files
aknot242alessfg
andauthored
Syncing main to remove master (#22)
* 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]>
1 parent 3bda56c commit 3cb5d6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+687
-836
lines changed

.ansible-lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
skip_list:
2+
- '106'

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To reproduce**
14+
Steps to reproduce the behavior:
15+
1. Deploy NGINX App Protect role using playbook.yml
16+
2. View output/logs/configuration on '...'
17+
3. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Your environment:**
23+
- Version of the NGINX App Protect role or specific commit
24+
- Version of Ansible
25+
- Target deployment platform
26+
27+
**Additional context**
28+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### Proposed changes
2+
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).
3+
4+
### Checklist
5+
Before creating a PR, run through this checklist and mark each as complete.
6+
7+
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx-app-protect/blob/main/CONTRIBUTING.md) document
8+
- [ ] I have added Molecule tests that prove my fix is effective or that my feature works
9+
- [ ] I have checked that all Molecule tests pass after adding my changes
10+
- [ ] I have updated any relevant documentation (`defaults/main.yml`, `README.md` and `CHANGELOG.md`)

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@ default.pem
3636

3737
# Scratch Directory
3838
scratch/
39-
40-
# nginx keys
41-
sample-playbook/license/nginx-repo.*

.travis.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
---
22
language: python
3-
python: "2.7"
4-
5-
# Use the new container infrastructure
6-
sudo: false
7-
8-
# Install ansible
9-
addons:
10-
apt:
11-
packages:
12-
- python-pip
13-
3+
services: docker
4+
jobs:
5+
include:
6+
- name: "Lint role"
7+
env:
8+
scenario: default
9+
before_install:
10+
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
11+
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
12+
- sudo apt-get update
13+
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
1414
install:
15-
# Install ansible
16-
- pip install ansible
17-
18-
# Check ansible version
19-
- ansible --version
20-
21-
# Create ansible.cfg with correct roles_path
22-
- printf '[defaults]\nroles_path=../' >ansible.cfg
23-
15+
- pip install ansible==2.9.13
16+
- pip install ansible-lint==4.3.4
17+
- pip install yamllint==1.24.2
18+
- pip install molecule==3.0.8
19+
- pip install docker==4.3.1
2420
script:
25-
# Basic role syntax check
26-
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
27-
21+
- travis_wait 50 molecule lint -s $scenario
2822
notifications:
29-
webhooks: https://galaxy.ansible.com/api/v1/notifications/
23+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

.yamllint

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
# Based on ansible-lint config
32
extends: default
43

54
rules:
@@ -9,25 +8,6 @@ rules:
98
brackets:
109
max-spaces-inside: 1
1110
level: error
12-
colons:
13-
max-spaces-after: -1
14-
level: error
15-
commas:
16-
max-spaces-after: -1
17-
level: error
18-
comments: disable
1911
comments-indentation: disable
20-
document-start: disable
21-
empty-lines:
22-
max: 3
23-
level: error
24-
hyphens:
25-
level: error
26-
indentation: disable
27-
key-duplicates: enable
2812
line-length: disable
29-
new-line-at-end-of-file: disable
30-
new-lines:
31-
type: unix
32-
trailing-spaces: disable
3313
truthy: disable

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Changelog
2+
3+
## 0.2.0 (September 10, 2020)
4+
5+
BREAKING CHANGES:
6+
7+
* All of the variables have been updated to prevent naming collisions when using other roles. Please see README.MD for new variable names.
8+
* Example playbook has been removed by collection authors in favor of using the Molecule configuration as a 'known-working' implementation.
9+
10+
ENHANCEMENTS:
11+
12+
* Huge refactoring by @alessfg to better unify this role with the structures present in the other nginxinc Ansible roles.
13+
* Update Ansible to 2.9.13 and Ansible Lint to 4.3.4.
14+
* Explicitly defined mode in relevant tasks for breaking changes in Ansible.
15+
* Role refactored to separate install and configure operations in preparation for an upcoming role split.
16+
17+
FEATURES:
18+
19+
* Molecule 3 testing foundation is in the project, and linting is being performed by TravisCI. Now time to write tests!
20+
21+
BUG FIXES:
22+
23+
* 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.
24+
* The RHEL and CentOS repository setups were incorrectly using a static gpgkey instead of using the variable as a source.
25+
26+
## 0.1.0 (September 9, 2020)
27+
28+
Supports App Protect 2.0, which brings a number of features including support for Ubuntu 18.04.
29+
30+
Release notes for NGINX App Protect 2.0: docs.nginx.com/nginx-app-protect/releases/#release-2-0

CONTRIBUTING.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ The following is a set of guidelines for contributing to the NGINX App Protect A
1414
* [Git Guidelines](#git-guidelines)
1515
* [Ansible Guidelines](#ansible-guidelines)
1616

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

1919
## Ask a Question
2020

21-
Please open an Issue on GitHub with the label `question`.
21+
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`.
2222

2323
## Getting Started
2424

25-
Follow our [Installation Guide](README.md#Installation) to install Ansible and Molecule and get ready to use the NGINX App Protect Ansible role.
25+
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.
2626

2727
### Project Structure
2828

29-
* The NGINX App Protect Ansible role is written in `yaml` and supports open source NGINX Plus.
29+
* The NGINX Ansible role is written in `yaml` and supports NGINX App Protect.
3030
* The project follows the standard [Ansible role directory structure](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html)
31-
* The main code is found at `tasks/`
32-
* The main variables can be found at `defaults/main/`
33-
* Configuration templates for NGINX can be found at `templates/`
31+
* The main code is found in `tasks/`
32+
* The main variables can be found in `defaults/main.yml`
33+
* Configuration templates for NGINX Plus and NGINX App Protect can be found in `templates/`
3434
* [Molecule](https://molecule.readthedocs.io/) tests can be found in `molecule/`.
35-
* CI/CD is done via Travis using `.travis.yml` Deployment yaml files, and Helm files are found at `deployments/`
35+
* CI/CD is done via Travis using `.travis.yml` deployment yaml files
3636

3737
## Contributing
3838

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

4747
### Open a Pull Request
4848

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

5252
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.
5353

5454
## Code Guidelines
5555

56+
### Ansible Guidelines
57+
58+
* Run `molecule lint` over your code to automatically resolve a lot of `yaml` and Ansible style issues.
59+
* Run `molecule test --all` on your code before you submit a PR to catch any potential issues.
60+
* Follow these guides on some good practices for Ansible:
61+
* <https://www.ansible.com/blog/ansible-best-practices-essentials>
62+
* <https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html>
63+
5664
### Git Guidelines
5765

5866
* Keep a clean, concise and meaningful git commit history on your branch (within reason), rebasing locally and squashing before submitting a PR
59-
* 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
67+
* 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
6068
* In the subject line, use the present tense ("Add feature" not "Added feature")
6169
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...")
6270
* Limit the subject line to 72 characters or less
6371
* Reference issues and pull requests liberally after the subject line
6472
* 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`)
65-
66-
### Ansible Guidelines
67-
68-
* Run `molecule lint` over your code to automatically resolve a lot of `yaml` and Ansible style issues.
69-
* Run `molecule test --all` on your code to catch any other issues.
70-
* Follow these guides on some good practices for Ansible:
71-
* <https://www.ansible.com/blog/ansible-best-practices-essentials>
72-
* <https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html>

0 commit comments

Comments
 (0)