Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 50a4b28

Browse files
committed
Update readme and set yamllint version (#7)
1 parent 7689004 commit 50a4b28

31 files changed

+240
-278
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Steps to reproduce the behavior:
2020
A clear and concise description of what you expected to happen.
2121

2222
**Your environment:**
23-
- Version of the NGINX Unit Role or specific commit
23+
- Version of the NGINX Unit role or specific commit
2424
- Version of Ansible
2525
- Target deployment platform
2626

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Describe the use case and detail of the change. If this PR addresses an issue on
44
### Checklist
55
Before creating a PR, run through this checklist and mark each as complete.
66

7-
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx-unit/blob/master/CONTRIBUTING.md) document
7+
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/CONTRIBUTING.md) document
88
- [ ] I have added Molecule tests that prove my fix is effective or that my feature works
99
- [ ] I have checked that all Molecule tests pass after adding my changes
1010
- [ ] I have updated any relevant documentation (`defaults/main/*.yml`, `README.md` and `CHANGELOG.md`)

.travis.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
language: python
33
services: docker
4+
branches:
5+
only:
6+
- main
47
jobs:
58
include:
6-
- name: "(Debian/Ubuntu) Install NGINX Unit and NGINX Unit modules"
9+
- name: (Debian/Ubuntu) Install NGINX Unit and NGINX Unit modules
710
env:
811
scenario: default
9-
- name: "(Alpine) Install NGINX Unit and NGINX Unit modules"
10-
env:
11-
scenario: default_alpine
12-
- name: "(CentOS) Install NGINX Unit and NGINX Unit modules"
12+
- name: (CentOS) Install NGINX Unit and NGINX Unit modules
1313
env:
1414
scenario: default_centos
1515
before_install:
@@ -18,10 +18,11 @@ before_install:
1818
- sudo apt-get update
1919
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
2020
install:
21-
- pip install ansible==2.9.13
22-
- pip install ansible-lint==4.3.4
23-
- pip install yamllint==1.24.2
24-
- pip install molecule==3.0.8
21+
- pip install ansible-base==2.10.3
22+
- pip install ansible==2.10.3
23+
- pip install ansible-lint==4.3.7
24+
- pip install yamllint==1.25.0
25+
- pip install 'molecule[docker]'==3.1.5
2526
- pip install docker==4.3.1
2627
script:
2728
- molecule --version

CHANGELOG.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
# Changelog
22

3-
## 0.2.1 (Unreleased)
3+
## 0.2.1 (November 19, 2020)
44

55
ENHANCEMENTS:
66

7-
* Update Ansible to `2.9.13` and Ansible Lint to `4.3.4`.
7+
* Update Ansible (now Ansible base) to `2.10.3`, Ansible (now Ansible Community Distribution) to `2.10.3`, Ansible Lint to `4.3.7`, Molecule to `3.1.5`, and yamllint to `1.25.0`.
8+
* Moved "constant" variables to `vars/main.yml`.
9+
* Switch to using `ansible_facts` wherever possible.
10+
* Major backend refactoring to reduce the number of files and tasks.
11+
* Improved tasks naming conventions.
12+
* Add survey to README.
13+
* Improve README structure and use tables where relevant.
814

915
## 0.2.0 (August 27, 2020)
1016

1117
BREAKING CHANGES:
1218

13-
* The repository names in Debian and RedHat based distros have slightly changed. 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.
19+
The repository names in Debian and RedHat based distros have slightly changed. 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.
20+
21+
FEATURES:
22+
23+
TravisCI now always uses the latest version of Docker.
1424

1525
ENHANCEMENTS:
1626

1727
* Update Ansible to `2.9.12` and Ansible Lint to `4.3.2`.
1828
* Explicitly define `mode` in relevant tasks.
1929
* Explicitly define the `nginx-unit` `apt_repository` and `yum_repository` filename in Debian and RedHat based distros.
2030

21-
FEATURES:
22-
23-
* TravisCI now always uses the latest version of Docker.
24-
2531
## 0.1.0 (August 19, 2020)
2632

2733
Initial release of the NGINX Unit role. Contains all NGINX Unit related features previously available on the [NGINX Ansible role](https://github.com/nginxinc/ansible-role-nginx).

CONTRIBUTING.md

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

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

1919
## Ask a Question
2020

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`.
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](https://github.com/nginxinc/ansible-role-nginx-unit/blob/master/README.md#Installation) to install Ansible and Molecule and get ready to use the NGINX Ansible role.
25+
Follow our [Installation Guide](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/README.md#Installation) to install Ansible and Molecule and get ready to use the NGINX Ansible role.
2626

2727
### Project Structure
2828

2929
* The NGINX Ansible role is written in `yaml` and supports NGINX Unit.
30-
* 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 in `tasks/`
32-
* The main variables can be found in `defaults/main/*.yml`
33-
* Configuration templates for NGINX can be found in `templates/`
34-
* [Molecule](https://molecule.readthedocs.io/) tests can be found in `molecule/`.
35-
* CI/CD is done via Travis using `.travis.yml` deployment yaml files
30+
* 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 in `tasks/`.
32+
* The main variables can be found in `defaults/main/*.yml`.
33+
* "Constant" variables can be found in `vars/main.yml`.
34+
* Configuration templates for NGINX can be found in `templates/`.
35+
* [Molecule](https://molecule.readthedocs.io/) tests can be found in `molecule/`..
36+
* CI/CD is done via Travis using `.travis.yml` deployment `yaml` files
3637

3738
## Contributing
3839

@@ -46,8 +47,8 @@ To suggest an enhancement, please create an issue on GitHub with the label `enha
4647

4748
### Open a Pull Request
4849

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

5253
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.
5354

@@ -63,10 +64,10 @@ Note: if you’d like to implement a new feature, please consider creating a fea
6364

6465
### Git Guidelines
6566

66-
* Keep a clean, concise and meaningful git commit history on your branch (within reason), rebasing locally and squashing before submitting a PR
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
68-
* In the subject line, use the present tense ("Add feature" not "Added feature")
69-
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...")
70-
* Limit the subject line to 72 characters or less
71-
* Reference issues and pull requests liberally after the subject line
72-
* 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`)
67+
* Keep a clean, concise and meaningful git commit history on your branch (within reason), rebasing locally and squashing before submitting a PR.
68+
* 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:
69+
* In the subject line, use the present tense ("Add feature" not "Added feature").
70+
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...").
71+
* Limit the subject line to 72 characters or less.
72+
* Reference issues and pull requests liberally after the subject line.
73+
* 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`).

README.md

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1-
Ansible NGINX Unit Role
2-
=======================
1+
[![Ansible Galaxy](https://img.shields.io/badge/galaxy-nginxinc.nginx__unit-5bbdbf.svg)](https://galaxy.ansible.com/nginxinc/nginx_unit)
2+
[![Build Status](https://travis-ci.org/nginxinc/ansible-role-nginx-unit.svg?branch=main)](https://travis-ci.org/nginxinc/ansible-role-nginx-unit)
3+
[![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4+
5+
# 👾 *Help make the NGINX config Ansible role better by participating in our [survey](https://forms.office.com/Pages/ResponsePage.aspx?id=L_093Ttq0UCb4L-DJ9gcUKLQ7uTJaE1PitM_37KR881UM0NCWkY5UlE5MUYyWU1aTUcxV0NRUllJSC4u)!* 👾
6+
7+
# Ansible NGINX Unit Role
38

49
This role installs NGINX Unit on your target host.
510

611
**Note:** This role is still in active development. There may be unidentified issues and the role variables may change as development continues.
712

8-
Requirements
9-
------------
10-
11-
**Ansible**
13+
## Requirements
1214

13-
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.
15+
### Ansible
1416

15-
Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
17+
* This role is 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.
18+
* Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
1619

17-
**Molecule**
20+
### Molecule
1821

19-
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/latest/installation.html).
22+
* Molecule `3.x` is used to test the various functionalities of the role.
23+
* Instructions on how to install Molecule can be found in the [Molecule website](https://molecule.readthedocs.io/en/latest/installation.html).
2024

21-
Installation
22-
------------
25+
## Installation
2326

24-
**Ansible Galaxy**
27+
### Ansible Galaxy
2528

2629
Use `ansible-galaxy install nginxinc.nginx_unit` to install the latest stable release of the role on your system.
2730

28-
**Git**
31+
### Git
2932

3033
Use `git clone https://github.com/nginxinc/ansible-role-nginx-unit.git` to pull the latest edge commit of the role from GitHub.
3134

32-
Platforms
33-
---------
35+
## Platforms
3436

3537
The NGINX Ansible role supports all platforms supported by [NGINX Unit](https://unit.nginx.org/installation/#official-packages):
3638

@@ -62,43 +64,44 @@ Ubuntu:
6264
- focal
6365
```
6466
65-
Role Variables
66-
--------------
67+
## Role Variables
6768
68-
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **`defaults/main`** directory in the following files:
69+
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **[`defaults/main/`](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/defaults/main/)** folder in the following files:
6970

70-
- **[defaults/main/main.yml](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/defaults/main/main.yml):** NGINX Unit installation variables
71-
- **[defaults/main/selinux.yml](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/defaults/main/unit.yml):** NGINX Unit SELinux variables
72-
- **[defaults/main/bsd.yml](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/defaults/main/bsd.yml):** BSD specific installation variables
71+
|Name|Description|
72+
|----|-----------|
73+
|**[`defaults/main/main.yml`](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/defaults/main/main.yml)**|NGINX Unit installation variables|
74+
|**[`defaults/main/selinux.yml`](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/defaults/main/unit.yml)**|NGINX Unit SELinux variables|
75+
|**[`defaults/main/bsd.yml`](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/defaults/main/bsd.yml)**|BSD specific installation variables|
7376

74-
Example Playbooks
75-
-----------------
77+
## Example Playbooks
7678

77-
A working functional playbook example can be found in the **`molecule/common`** directory in the following file:
79+
A working functional playbook example can be found in the **[`molecule/common/playbooks`](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/molecule/common/)** folder in the following file:
7880

79-
**[molecule/common/playbooks/default_converge.yml](https://github.com/nginxinc/ansible-role-nginx-unit/blob/master/molecule/common/playbooks/default_converge.yml):** Install NGINX Unit
81+
|Name|Description|
82+
|----|-----------|
83+
|**[`molecule/common/playbooks/default_converge.yml`](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/molecule/common/playbooks/default_converge.yml)**|Install NGINX Unit|
8084

8185
Do note that if you install this repository via Ansible Galaxy, you will have to replace the role variable in the sample playbooks from `ansible-role-nginx-unit` to `nginxinc.nginx_unit`.
8286

83-
Other NGINX Roles
84-
-----------------
87+
## Other NGINX Ansible Collections and Roles
8588

86-
You can find an Ansible role to install and configure NGINX [here](https://github.com/nginxinc/ansible-role-nginx)
89+
You can find the Ansible NGINX Core collection of roles to install and configure NGINX Open Source, NGINX Plus, and NGINX App Protect [here](https://github.com/nginxinc/ansible-collection-nginx).
8790

88-
You can find an Ansible role to install and configure NGINX App Protect [here](https://github.com/nginxinc/ansible-role-nginx-app-protect)
91+
You can find the Ansible NGINX role to install NGINX [here](https://github.com/nginxinc/ansible-role-nginx).
8992

90-
You can find an Ansible collection of roles to install and configure NGINX Controller [here](https://github.com/nginxinc/ansible-collection-nginx_controller)
93+
You can find the Ansible NGINX configuration role to configure NGINX [here](https://github.com/nginxinc/ansible-role-nginx-config).
9194

92-
License
93-
-------
95+
You can find the Ansible NGINX App Protect role to install and configure NGINX App Protect [here](https://github.com/nginxinc/ansible-role-nginx-app-protect).
9496

95-
[Apache License, Version 2.0](https://github.com/nginxinc/ansible-role-nginx/blob/main/LICENSE)
97+
You can find the Ansible NGINX Controller collection of roles to install and configure NGINX Controller [here](https://github.com/nginxinc/ansible-collection-nginx_controller).
9698

97-
Author Information
98-
------------------
99+
## License
99100

100-
[Alessandro Fael Garcia](https://github.com/alessfg)
101+
[Apache License, Version 2.0](https://github.com/nginxinc/ansible-role-nginx-unit/blob/main/LICENSE)
102+
103+
## Author Information
101104

102-
[Tom Gamull](https://github.com/magicalyak)
105+
[Alessandro Fael Garcia](https://github.com/alessfg)
103106

104107
&copy; [F5 Networks, Inc.](https://www.f5.com/) 2020

defaults/main/bsd.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ nginx_unit_bsd_install_packages: true
88
# Options are true for use packages or false for do not use packages.
99
# Default is true.
1010
nginx_unit_bsd_portinstall_use_packages: true
11-
12-
# FreeBSD extra packages
13-
nginx_unit_freebsd_extra_packages: ['security/ca_root_nss']

defaults/main/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ nginx_unit_modules: []
77

88
# Choose where to fetch the NGINX signing key from.
99
# Default is the official NGINX signing key host.
10-
# nginx_signing_key: http://nginx.org/keys/nginx_signing.key
10+
# nginx_unit_signing_key: http://nginx.org/keys/nginx_signing.key

handlers/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
- name: "(Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit"
2+
- name: (Handler - Amazon Linux/CentOS/Debian/RedHat/Ubuntu) Start NGINX Unit
33
service:
44
name: unit
55
state: started
66
enabled: yes
77

8-
- name: "(Handler: FreeBSD) Start NGINX Unit"
8+
- name: (Handler - FreeBSD) Start NGINX Unit
99
service:
1010
name: unitd
1111
state: started

molecule/common/Dockerfile.j2

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@ ENV {{ var }} {{ value }}
1717
RUN \
1818
if [ $(command -v apt-get) ]; then \
1919
apt-get update \
20-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y python3 sudo bash ca-certificates iproute2 python3-apt aptitude systemd systemd-sysv procps curl \
20+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y aptitude bash ca-certificates curl iproute2 python-apt python3 python3-apt procps sudo systemd systemd-sysv vim \
2121
&& apt-get clean; \
2222
elif [ $(command -v dnf) ]; then \
2323
dnf makecache \
24-
&& dnf --assumeyes install /usr/bin/python3 /usr/bin/python3-config /usr/bin/dnf-3 bash iproute \
24+
&& dnf --assumeyes install bash iproute /usr/bin/dnf-3 /usr/bin/python3 /usr/bin/python3-config vim \
2525
&& dnf clean all; \
2626
elif [ $(command -v yum) ]; then \
2727
yum makecache fast \
28-
&& yum install -y /usr/bin/python /usr/bin/python2-config sudo yum-plugin-ovl bash iproute \
28+
&& yum install -y bash iproute /usr/bin/python /usr/bin/python2-config sudo vim yum-plugin-ovl \
2929
&& sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf \
3030
&& yum clean all; \
3131
elif [ $(command -v zypper) ]; then \
3232
zypper refresh \
33-
&& zypper install -y python3 sudo bash iproute2 \
33+
&& zypper install -y bash iproute2 python3 sudo vim \
3434
&& zypper clean -a; \
3535
elif [ $(command -v apk) ]; then \
3636
apk update \
37-
&& apk add --no-cache python3 sudo bash ca-certificates curl openrc; \
37+
&& apk add --no-cache bash ca-certificates curl openrc python3 sudo vim; \
3838
echo 'rc_provide="loopback net"' >> /etc/rc.conf; \
3939
elif [ $(command -v xbps-install) ]; then \
4040
xbps-install -Syu \
41-
&& xbps-install -y python3 sudo bash ca-certificates iproute2 \
41+
&& xbps-install -y bash ca-certificates iproute2 python3 sudo vim \
4242
&& xbps-remove -O; \
4343
fi

molecule/common/playbooks/default_converge.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
- unit-perl
99
- unit-php7
1010
- unit-python3
11-
when: ansible_os_family == "Alpine"
12-
- name: Set module if Debian/RedHat
11+
when: ansible_facts['os_family'] == "Alpine"
12+
- name: Set module if Debian
1313
set_fact:
1414
module:
1515
- unit-perl
1616
- unit-php
1717
- unit-ruby
18-
when: ansible_os_family == "Debian"
19-
- name: Set module if RedHat
18+
when: ansible_facts['os_family'] == "Debian"
19+
- name: Set module if Red Hat
2020
set_fact:
2121
module:
2222
- unit-php
2323
- unit-go
24-
when: ansible_os_family == "RedHat"
24+
when: ansible_facts['os_family'] == "RedHat"
2525
tasks:
2626
- name: Install NGINX Unit
2727
include_role:

0 commit comments

Comments
 (0)