Skip to content
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

Adds ability to detect modified nginx for fact #913

Merged

Conversation

petems
Copy link
Member

@petems petems commented Oct 9, 2016

Rebase and refactor of #890.

Adds ability to detect modified nginx for fact
* For instance openresty: http://openresty.org/en/) is installed.
* Openresty can be installed from a package or compiled
* This allows it to have two possible paths: nginx or openresty
* Fact and spec updated to detect both paths
* Regex updated to capture openresty output
* Added spec for no nginx or openresty install
* Moved spec to correct path (not in util folder)

* For instance openresty: http://openresty.org/en/) is installed.
* Openresty can be installed from a package or compiled
* This allows it to have two possible paths: nginx or openresty
* Fact and spec updated to detect both paths
* Regex updated to capture openresty output
* Added spec for no nginx or openresty install
* Moved spec to correct path (not in util folder)
* Added exception for nested examples, as it makes Facter tests easier to read
@petems petems force-pushed the fix_fact_for_openresty_install_and_spec branch from bccbc0b to 160b6ae Compare October 9, 2016 18:30
@bastelfreak bastelfreak merged commit 3d2ad10 into voxpupuli:master Oct 9, 2016
if Facter.value('kernel') != 'windows' && (Facter::Util::Resolution.which('nginx') || Facter::Util::Resolution.which('openresty'))
nginx_version_command = Facter::Util::Resolution.which('nginx') ? 'nginx -v 2>&1' : 'openresty -v 2>&1'
nginx_version = Facter::Util::Resolution.exec(nginx_version_command)
%r{nginx version: (nginx|openresty)\/([\w\.]+)}.match(nginx_version)[2]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to just do
%r{nginx version: (?:nginx|openresty)\/([\w\.]+)}.match(nginx_version)[1] here?

Or capture it but create a new fact nginx_flavor or similar?

@petems petems deleted the fix_fact_for_openresty_install_and_spec branch October 11, 2016 09:57
@wyardley wyardley mentioned this pull request Oct 11, 2016
Rubueno pushed a commit to Rubueno/puppet-nginx that referenced this pull request Oct 19, 2020
…nstall_and_spec

Adds ability to detect modified nginx for fact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants