File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed
Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 3535
3636describe 'NGinx http content' do
3737
38- describe command "curl -s -L http://127.0.0.1:1080 | grep h1 " do
38+ describe command "curl -s -L http://127.0.0.1:1080" do
3939 its ( :exit_status ) { should eq 0 }
40- its ( :stdout ) { should match "<h1>Welcome to nginx!</h1> " }
40+ its ( :stdout ) { should match "Hello test1 " }
4141 end
4242end
4343
Original file line number Diff line number Diff line change 1717 name : /,
1818 type : location,
1919 try_files : " $uri $uri/ /index.html" ,
20- root : " {{ nginx_default_root }} "
20+ root : " /nginx/test1/ "
2121 }
22- # # Use yaml
23- location2 :
24- name : /doc/
25- type : location
26- alias : " /usr/share/doc/"
27- autoindex : " on"
28- allow : " 127.0.0.2"
29- deny : " all"
3022 pre_tasks :
3123 - name : update apt
3224 apt : update_cache=yes cache_valid_time=3600
3325
26+ - name : Create dir for content
27+ file :
28+ path="/nginx/{{ item }}"
29+ state=directory
30+ mode=0755
31+ with_items :
32+ - test1
33+
34+ - name : Create content for test
35+ copy :
36+ content="Hello {{ item }}"
37+ dest="/nginx/{{ item }}/index.html"
38+ mode=0644
39+ with_items :
40+ - test1
41+
3442 roles :
3543 - " ansible-nginx"
3644
You can’t perform that action at this time.
0 commit comments