-
Notifications
You must be signed in to change notification settings - Fork 81
feat: Add support for the NGINX ngx_mgmt_module module. #562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: Configure NGINX | ||
ansible.builtin.include_role: | ||
name: ansible-role-nginx-config | ||
vars: | ||
nginx_config_debug_output: true | ||
|
||
nginx_config_main_template_enable: true | ||
nginx_config_main_template: | ||
template_file: nginx.conf.j2 | ||
deployment_location: /etc/nginx/nginx.conf | ||
config: | ||
main: | ||
user: nginx | ||
worker_processes: auto | ||
error_log: | ||
- file: /var/log/nginx/error.log | ||
level: notice | ||
pid: /var/run/nginx.pid | ||
worker_rlimit_nofile: 2048 | ||
events: | ||
worker_connections: 1024 | ||
mgmt: | ||
enforce_initial_report: true | ||
license_token: license.jwt | ||
# proxy: | ||
# proxy_username: | ||
# proxy_password: | ||
resolver: | ||
address: 127.0.0.1 | ||
valid: 30s | ||
ipv4: true | ||
ipv6: true | ||
status_zone: mgmt_mem_zone | ||
# ssl_crl: /path/to/file | ||
# ssl_trusted_certificate: /path/to/file | ||
ssl_verify: false | ||
state_path: /var/lib/nginx/state | ||
usage_report: | ||
endpoint: product.connect.nginx.com | ||
interval: 30m | ||
http: | ||
include: | ||
- /etc/nginx/conf.d/*.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
options: | ||
role-file: molecule/common/requirements/oss_requirements.yml | ||
driver: | ||
name: docker | ||
lint: | | ||
set -e | ||
ansible-lint --force-color | ||
platforms: | ||
- name: alpine-3.19 | ||
image: alpine:3.19 | ||
dockerfile: ../common/Dockerfile.j2 | ||
privileged: true | ||
cgroupns_mode: host | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
command: /sbin/init | ||
- name: debian-bullseye | ||
image: debian:bullseye-slim | ||
dockerfile: ../common/Dockerfile.j2 | ||
privileged: true | ||
cgroupns_mode: host | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
command: /sbin/init | ||
- name: rhel-9 | ||
image: redhat/ubi9:9.4 | ||
dockerfile: ../common/Dockerfile.j2 | ||
privileged: true | ||
cgroupns_mode: host | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
command: /usr/sbin/init | ||
- name: ubuntu-jammy | ||
image: ubuntu:jammy | ||
dockerfile: ../common/Dockerfile.j2 | ||
privileged: true | ||
cgroupns_mode: host | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
command: /sbin/init | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
prepare: prepare.yml | ||
converge: converge.yml | ||
verify: verify.yml | ||
env: | ||
ANSIBLE_ROLES_PATH: ~/.cache/molecule/ansible-role-nginx-config/${MOLECULE_SCENARIO_NAME}/roles:${MOLECULE_PROJECT_DIRECTORY}/..:~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
- name: Prepare | ||
hosts: localhost | ||
gather_facts: false | ||
tasks: | ||
- name: Create ephemeral license certificate file from b64 decoded env var | ||
ansible.builtin.copy: | ||
content: "{{ lookup('env', 'NGINX_CRT') | b64decode }}" | ||
dest: ../common/files/license/nginx-repo.crt | ||
force: false | ||
mode: "0444" | ||
|
||
- name: Create ephemeral license key file from b64 decoded env var | ||
ansible.builtin.copy: | ||
content: "{{ lookup('env', 'NGINX_KEY') | b64decode }}" | ||
dest: ../common/files/license/nginx-repo.key | ||
force: false | ||
mode: "0444" | ||
|
||
- name: Create ephemeral license JWT file from b64 encoded env var | ||
ansible.builtin.copy: | ||
content: "{{ lookup('env', 'NGINX_JWT') }}" | ||
dest: ../common/files/license/license.jwt | ||
force: false | ||
mode: "0444" | ||
|
||
- name: Install NGINX Plus | ||
hosts: all | ||
tasks: | ||
- name: Install NGINX Plus | ||
ansible.builtin.include_role: | ||
name: nginxinc.nginx | ||
vars: | ||
nginx_type: plus | ||
nginx_license: | ||
certificate: ../common/files/license/nginx-repo.crt | ||
key: ../common/files/license/nginx-repo.key | ||
jwt: ../common/files/license/license.jwt | ||
nginx_remove_license: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
tasks: | ||
- name: Check if NGINX Plus is installed | ||
ansible.builtin.package: | ||
name: nginx-plus | ||
state: present | ||
check_mode: true | ||
register: install | ||
failed_when: (install is changed) or (install is failed) | ||
|
||
- name: Check if NGINX service is running | ||
ansible.builtin.service: | ||
name: nginx | ||
state: started | ||
enabled: true | ||
check_mode: true | ||
register: service | ||
failed_when: (service is changed) or (service is failed) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.