Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
offline: true
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
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 Controller Agent 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 Controller Agent role or specific commit
- Version of Ansible
- Version of Jinja2 (if you are using any templating capability)
- Target deployment platform

### Additional context
Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
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.
9 changes: 9 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Security Policy

## Supported Versions

This role mainly consists of Ansible tasks. Ansible applies security fixes to the most recent three releases. Please find more information in [the Ansible docs](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html#release-status).

## Reporting a Vulnerability

If you find a security vulnerability that affects Ansible, we encourage you to report it according to the [Ansible guidelines](https://docs.ansible.com/ansible/devel/community/reporting_bugs_and_features.html#reporting-a-bug).
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/.github/workflows/requirements"
schedule:
interval: "daily"
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-controller-agent/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 any relevant Molecule tests pass after adding my changes
- [ ] I have updated any relevant documentation (`defaults/main/*.yml`, `README.md` and `CHANGELOG.md`)
99 changes: 99 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
name-template: "$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
categories:
- title: "💣 Breaking Changes"
labels:
- "breaking change"
- title: "🔔 Deprecation Warnings"
labels:
- "deprecation"
- title: "🚀 Features"
labels:
- "feature"
- title: "🎉 Enhancements"
labels:
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "bug"
- title: "📝 Documentation"
labels:
- "documentation"
- title: "⬆️ Dependencies"
labels:
- "dependencies"
exclude-labels:
- "skip-changelog"
version-resolver:
minor:
labels:
- "breaking change"
- "deprecation"
patch:
labels:
- "bug"
- "dependencies"
- "documentation"
- "feature"
- "enhancement"
default: patch
autolabeler:
- label: "breaking change"
body:
- "/breaking/i"
- label: "deprecation"
branch:
- "/deprecate\/.+/"
title:
- "/deprecate/i"
- label: "feature"
branch:
- "/feat\/.+/"
- "/feature\/.+/"
- "/implement\/.+/"
title:
- "/feat/i"
- "/feature/i"
- "/implement/i"
- label: "enhancement"
branch:
- "/add\/.+/"
- "/enhancement\/.+/"
title:
- "/add/i"
- "/enhancement/i"
- label: "bug"
branch:
- "/fix\/.+/"
title:
- "/fix/i"
- label: "documentation"
branch:
- "/docs\/.+/"
files:
- "**/!(changelog).md"
title:
- "/docs/i"
- "/documentation/i"
- label: "dependencies"
files:
- ".github/workflows/requirements/*"
template: |
👾 *Help make the NGINX Controller Agent Ansible role better by participating in our [survey](https://forms.office.com/Pages/ResponsePage.aspx?id=L_093Ttq0UCb4L-DJ9gcUKLQ7uTJaE1PitM_37KR881UM0NCWkY5UlE5MUYyWU1aTUcxV0NRUllJSC4u)!* 👾

## What's new in NGINX's Controller Agent Ansible role $RESOLVED_VERSION!

$CHANGES

## Install & Upgrade

* To install the Ansible NGINX Controller Agent role on a fresh environment, run `ansible-galaxy install nginxinc.nginx_controller_agent`.
* To upgrade the Ansible NGINX Controller Agent role to the latest release, run `ansible-galaxy install -f nginxinc.nginx_controller_agent`.
* To install or upgrade to this specific Ansible NGINX Controller Agent role release ($RESOLVED_VERSION), run `ansible-galaxy install -f nginxinc.nginx_controller_agent,v$RESOLVED_VERSION`.

## Resources

* Functional configuration examples (check `converge.yml` under each `molecule` scenario) -- [github.com/nginxinc/ansible-role-nginx-controller-agent/tree/$RESOLVED_VERSION/molecule](https://github.com/nginxinc/ansible-role-nginx-controller-agent/tree/$RESOLVED_VERSION/molecule).
* Ansible Galaxy repository -- [galaxy.ansible.com/nginxinc/nginx_controller_agent](https://galaxy.ansible.com/nginxinc/nginx_controller_agent).
* NGINX: Better with Ansible demo -- [github.com/alessfg/nginx-ansible-demo](https://github.com/alessfg/nginx-ansible-demo).
24 changes: 24 additions & 0 deletions .github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Ansible Galaxy import
"on":
release:
types:
- published
jobs:
galaxy:
name: Galaxy
runs-on: ubuntu-20.04
steps:
- name: Check out the codebase
uses: actions/checkout@v2.3.4

- name: Set up Python 3
uses: actions/setup-python@v2.2.2
with:
python-version: 3.x

- name: Install Ansible
run: pip3 install -r .github/workflows/requirements/requirements_galaxy.txt

- name: Import release to Ansible Galaxy
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
47 changes: 47 additions & 0 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Molecule CI/CD
"on":
pull_request:
branches:
- main
push:
branches:
- main
ignore-tags:
- "*"
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:
jobs:
molecule:
name: Molecule
runs-on: ubuntu-20.04
strategy:
matrix:
scenario:
- default
steps:
- name: Check out the codebase
if: "!(matrix.scenario == 'default' && github.event.pull_request.head.repo.full_name != github.repository)"
uses: actions/checkout@v2.3.4

- name: Set up Python 3
if: "!(matrix.scenario == 'default' && github.event.pull_request.head.repo.full_name != github.repository)"
uses: actions/setup-python@v2.2.2
with:
python-version: 3.x

- name: Install Molecule dependencies
if: "!(matrix.scenario == 'default' && github.event.pull_request.head.repo.full_name != github.repository)"
run: pip3 install -r .github/workflows/requirements/requirements_molecule.txt

- name: Install Ansible base dependencies
if: "!(contains(matrix.scenario, 'default') && github.event.pull_request.head.repo.full_name != github.repository)"
run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml

- name: Run Molecule tests
if: "!(matrix.scenario == 'default' && github.event.pull_request.head.repo.full_name != github.repository)"
run: molecule test -s ${{ matrix.scenario }}
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
19 changes: 19 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Release Drafter
"on":
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- main
jobs:
update_release_draft:
name: Update release draft
runs-on: ubuntu-20.04
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/requirements/requirements_ansible.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
collections:
- name: community.docker
version: 1.7.0
1 change: 1 addition & 0 deletions .github/workflows/requirements/requirements_galaxy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansible-core==2.11.4
6 changes: 6 additions & 0 deletions .github/workflows/requirements/requirements_molecule.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ansible-core==2.11.4
Jinja2==3.0.1
ansible-lint==5.1.2
yamllint==1.26.3
molecule[docker]==3.4.0
docker==5.0.0
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Any private crt and keys #
############################
*.crt
*.key
*~
\#*
!molecule.crt
!molecule.key

# OS Specific #
###############
Thumbs.db
.DS_Store
.vscode

# Ansible specific #
####################
.cache
*.retry

# Python specific #
###################
__pycache__
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .yamllint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
extends: default

rules:
Expand All @@ -9,4 +10,3 @@ rules:
level: error
comments-indentation: disable
line-length: disable
truthy: disable
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ Author Information

[Daniel Edgar](https://github.com/aknot242)

© [NGINX, Inc.](https://www.nginx.com/) 2020
© [NGINX, Inc.](https://www.nginx.com/) 2021
2 changes: 2 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ galaxy_info:
description: A role to install, configure, and upgrade the NGINX Controller agent alongside an NGINX Plus instance in a machine.
company: F5 Networks, Inc.
role_name: nginx_controller_agent
namespace: nginxinc

license: Apache License, Version 2.0

Expand All @@ -28,6 +29,7 @@ galaxy_info:
versions:
- xenial
- bionic
- focal

galaxy_tags:
- nginx
Expand Down
22 changes: 22 additions & 0 deletions molecule/MockServerDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# MockServer Dockerfile
#
# https://github.com/mock-server/mockserver
# http://www.mock-server.com
#

# build image
FROM alpine:3.12

# download jar
RUN apk add --update openssl ca-certificates bash wget curl openrc python3 sudo openjdk11-jre
# REPOSITORY is releases or snapshots
ARG REPOSITORY=releases
# VERSION is LATEST or RELEASE or x.x.x
ARG VERSION=RELEASE
# see: https://oss.sonatype.org/nexus-restlet1x-plugin/default/docs/path__artifact_maven_redirect.html
ARG REPOSITORY_URL=https://oss.sonatype.org/service/local/artifact/maven/redirect?r=${REPOSITORY}&g=org.mock-server&a=mockserver-netty&c=jar-with-dependencies&e=jar&v=${VERSION}
RUN wget --max-redirect=10 -O mockserver-netty-jar-with-dependencies.jar "$REPOSITORY_URL"

# expose ports.
EXPOSE 1080
11 changes: 11 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Converge
hosts: instances
tasks:
- name: Call Agent Role
include_role:
name: ansible-role-nginx-controller-agent
vars:
nginx_controller_fqdn: mock-server.molecule-test:1080
nginx_controller_validate_certs: false
nginx_controller_api_key: "ABC123"
Loading