Go to file
2022-02-03 11:45:11 -03:00
.github/workflows ci(vagrant): replace FreeBSD 12.2 with 12.3 [skip ci] 2021-12-24 14:05:57 +00:00
bin ci(pre-commit): add to formula [skip ci] 2020-10-03 10:40:33 +01:00
docs refactor(pkgs): readbility 2022-02-03 10:53:14 -03:00
nginx revert(pkg): use grains.osfinger in a format suitable for all platforms 2022-02-03 11:45:11 -03:00
test refactor(pkgs): readbility 2022-02-03 10:53:14 -03:00
.gitignore ci(kitchen+ci): update with latest CVE pre-salted images [skip ci] 2021-10-05 11:14:59 +01:00
.gitlab-ci.yml ci(kitchen+ci): update with 3004 pre-salted images/boxes [skip ci] 2021-11-23 10:35:12 +00:00
.pre-commit-config.yaml ci(3003.1): update inc. AlmaLinux, Rocky & rst-lint [skip ci] 2021-07-02 00:04:51 +01:00
.rstcheck.cfg chore(pre-commit): use info report level for rstcheck [skip ci] 2021-05-20 14:08:42 +01:00
.rubocop.yml test: standardise use of share suite & _mapdata state [skip ci] 2021-03-23 21:30:37 +00:00
.salt-lint ci(travis): update salt-lint config for v0.0.10 [skip ci] 2019-10-23 17:36:22 +01:00
.travis.yml ci(kitchen+ci): update with 3004 pre-salted images/boxes [skip ci] 2021-11-23 10:35:12 +00:00
.yamllint ci: add Debian 11 Bullseye & update yamllint configuration [skip ci] 2021-07-18 19:02:41 +01:00
AUTHORS.md chore(release): 2.7.4 [skip ci] 2021-06-15 18:22:04 +00:00
CHANGELOG.md chore(release): 2.7.4 [skip ci] 2021-06-15 18:22:04 +00:00
CODEOWNERS ci(kitchen+ci): update with 3004 pre-salted images/boxes [skip ci] 2021-11-23 10:35:12 +00:00
commitlint.config.js chore(commitlint): add {body,footer,header}-max(-line)-length [skip ci] 2020-10-07 09:07:47 +01:00
FORMULA chore(release): 2.7.4 [skip ci] 2021-06-15 18:22:04 +00:00
Gemfile chore(gemfile.lock): update to latest gem versions (2022-W05) [skip ci] 2022-02-01 23:40:26 +00:00
Gemfile.lock chore(gemfile.lock): update to latest gem versions (2022-W05) [skip ci] 2022-02-01 23:40:26 +00:00
kitchen.vagrant.yml ci(vagrant): replace FreeBSD 12.2 with 12.3 [skip ci] 2021-12-24 14:05:57 +00:00
kitchen.yml ci(kitchen+ci): update with 3004 pre-salted images/boxes [skip ci] 2021-11-23 10:35:12 +00:00
LICENSE Update LICENSING year 2015-03-20 20:06:14 -04:00
pillar.example feat(servers_config): add require statement to manage dependencies 2021-04-28 09:37:34 -03:00
pre-commit_semantic-release.sh chore(semantic-release): replace broken m2r with m2r2 [skip ci] 2022-01-17 08:14:46 +00:00
release-rules.js docs(semantic-release): implement an automated changelog 2019-04-26 09:11:11 +01:00
release.config.js ci(gitlab-ci): use GitLab CI as Travis CI replacement 2020-12-16 06:36:27 +00:00
VERSION Adds basic ng state functionality. 2014-05-15 18:06:48 -04:00

nginx-formula

Travis CI Build Status Semantic Release

Formula to set up and configure NGINX.

WARNING: BREAKING CHANGES SINCE v1.0.0

Prior to v1.0.0, this formula provided two methods for managing NGINX; the old method under nginx and the new method under nginx.ng. The old method has now been removed and nginx.ng has been promoted to be nginx in its place.

If you are not in a position to migrate, please pin your repo to the final release tag before v1.0.0, i.e. v0.56.1.

To migrate from nginx.ng, simply modify your pillar to promote the entire section under nginx:ng so that it is under nginx instead. So with the editor of your choice, highlight the entire section and then unindent one level. Finish by removing the ng: line.

To migrate from the old nginx, first convert to nginx.ng under v0.56.1 and then follow the steps laid out in the paragraph directly above.

Table of Contents

General notes

See the full SaltStack Formulas installation and usage instructions.

If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.

If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning.

See Formula Versioning Section for more details.

Contributing to this repo

Commit message formatting is significant!!

Please see How to contribute for more details.

Available states

nginx

Meta-state for inclusion of all states.

Note: nginx requires the merge parameter of salt.modules.pillar.get(), first available in the Helium release.

nginx.pkg

Installs nginx from package, from the distribution repositories, the official nginx repo or the ppa from Launchpad.

nginx.src

Builds and installs nginx from source.

nginx.certificates

Manages the deployment of nginx certificates.

nginx.config

Manages the nginx main server configuration file.

nginx.service

Manages the startup and running state of the nginx service.

nginx.servers_config

Manages virtual host files. This state only manages the content of the files and does not bind them to service calls.

nginx.servers

Manages nginx virtual hosts files and binds them to service calls.

nginx.passenger

Installs and configures Phusion Passenger module for nginx. You need to enable the upstream phusion passenger repository with install_from_phusionpassenger: true. Nginx will also be installed from that repository, as it needs to be modified to allow the passenger module to work.

Testing

Linux testing is done with kitchen-salt.

Requirements

  • Ruby
  • Docker
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.yml, e.g. debian-9-2019-2-py3.

bin/kitchen converge

Creates the docker instance and runs the nginx main state, ready for testing.

bin/kitchen verify

Runs the inspec tests on the actual instance.

bin/kitchen destroy

Removes the docker instance.

bin/kitchen test

Runs all of the stages above in one go: i.e. destroy + converge + verify + destroy.

bin/kitchen login

Gives you SSH access to the instance for manual testing.

Testing with Vagrant

Windows/FreeBSD/OpenBSD testing is done with kitchen-salt.

Requirements

  • Ruby
  • Virtualbox
  • Vagrant

Setup

$ gem install bundler
$ bundle install --with=vagrant
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.vagrant.yml, e.g. windows-81-latest-py3.

Note

When testing using Vagrant you must set the environment variable KITCHEN_LOCAL_YAML to kitchen.vagrant.yml. For example:

$ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test      # Alternatively,
$ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml
$ bin/kitchen test

Then run the following commands as needed.

bin/kitchen converge

Creates the Vagrant instance and runs the nginx main state, ready for testing.

bin/kitchen verify

Runs the inspec tests on the actual instance.

bin/kitchen destroy

Removes the Vagrant instance.

bin/kitchen test

Runs all of the stages above in one go: i.e. destroy + converge + verify + destroy.

bin/kitchen login

Gives you RDP/SSH access to the instance for manual testing.