suites: | suites: | ||||
- name: default | - name: default | ||||
provisioner: | provisioner: | ||||
dependencies: | |||||
- name: test_dep | |||||
path: test/salt/default/states | |||||
state_top: | state_top: | ||||
base: | base: | ||||
'*': | '*': | ||||
- test_dep.create_dependency_file | |||||
- nginx._mapdata | - nginx._mapdata | ||||
- nginx | - nginx | ||||
pillars: | pillars: |
its('content') { should include 'try_files $uri $uri/ =404;' } | its('content') { should include 'try_files $uri $uri/ =404;' } | ||||
its('content') { should include 'include snippets/letsencrypt.conf;' } | its('content') { should include 'include snippets/letsencrypt.conf;' } | ||||
end | end | ||||
describe file "#{dir}/mysite_with_require" do | |||||
it { should be_file } | |||||
it { should be_owned_by file_owner } | |||||
it { should be_grouped_into file_group } | |||||
its('mode') { should cmp '0644' } | |||||
its('content') { should include 'server_name with-deps;' } | |||||
its('content') { should include 'listen 80;' } | |||||
its('content') { should include 'index index.html index.htm;' } | |||||
its('content') { should include 'location ~ .htm {' } | |||||
its('content') { should include 'try_files $uri $uri/ =404;' } | |||||
end | |||||
end | end | ||||
end | end |
# frozen_string_literal: true | |||||
control 'Dependency test file' do | |||||
title 'should exist' | |||||
describe file('/tmp/created_to_test_dependencies') do | |||||
it { should be_file } | |||||
end | |||||
end |
- location ~ .htm: | - location ~ .htm: | ||||
- try_files: '$uri $uri/ =404' | - try_files: '$uri $uri/ =404' | ||||
- include: 'snippets/letsencrypt.conf' | - include: 'snippets/letsencrypt.conf' | ||||
mysite_with_require: | |||||
enabled: true | |||||
config: | |||||
- server: | |||||
- server_name: with-deps | |||||
- listen: | |||||
- '80' | |||||
- index: 'index.html index.htm' | |||||
- location ~ .htm: | |||||
- try_files: '$uri $uri/ =404' | |||||
requires: | |||||
file: created_to_test_dependencies | |||||
dh_param: | dh_param: | ||||
'mydhparam2.pem': | 'mydhparam2.pem': | ||||
keysize: 2048 | keysize: 2048 |
## this state creates a file that is used to test vhosts dependencies | |||||
# (see https://github.com/saltstack-formulas/nginx-formula/pull/278) | |||||
created_to_test_dependencies: | |||||
file.managed: | |||||
- name: /tmp/created_to_test_dependencies |