38 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
| ---
 | |
| language: python
 | |
| python: "2.7"
 | |
| before_install:
 | |
|   - sudo apt-get update -qq
 | |
|   - sudo apt-get install -qq python-apt python-pycurl
 | |
| install:
 | |
|   - pip install ansible ansible-lint
 | |
|   - ansible --version
 | |
| script:
 | |
|   - ansible-lint tasks/main.yml
 | |
|   - echo localhost > inventory
 | |
|   - ansible-playbook -i inventory --syntax-check --list-tasks test/test.yml -e "role_name=ansible-role-nginx" -e "hosts_group=hosts_group"
 | |
|   - ansible-playbook -i inventory --connection=local --sudo -vvvv test/test.yml -u root -e "role_name=ansible-role-nginx" -e "hosts_group=localhost"
 | |
|   - >
 | |
|       ansible-playbook -i inventory --connection=local --sudo -vvvv test/test.yml -u root -e "role_name=ansible-role-nginx" -e "hosts_group=localhost"
 | |
|       | grep -q 'changed=0.*failed=0'
 | |
|       && (echo 'Idempotence test: pass' && exit 0)
 | |
|       || (echo 'Idempotence test: fail' && exit 1)      
 | |
|   - cat /etc/nginx/nginx.conf
 | |
|   - cat /etc/nginx/sites-enabled/default.conf
 | |
|   - cat /etc/nginx/sites-enabled/foo.conf
 | |
|   - cat /etc/nginx/sites-enabled/bar.conf
 | |
|   - cat /etc/nginx/sites-enabled/custom_bar.conf
 | |
|   - grep 'server_name bar.example.com;' /etc/nginx/sites-enabled/custom_bar.conf
 | |
|   - cat /etc/nginx/conf.d/proxy.conf
 | |
|   - cat /etc/nginx/conf.d/upstream.conf
 | |
|   - cat /etc/nginx/conf.d/geo.conf
 | |
|   - cat /etc/nginx/conf.d/gzip.conf
 | |
|   - cat /etc/nginx/snippets/error_pages.conf
 | |
|   - sudo cat /etc/nginx/auth_basic/demo
 | |
|   - sudo nginx -t
 | |
| after_script:
 | |
|   - ls -l /etc/nginx
 | |
|   - ls -l /etc/nginx/*
 | |
| notifications:
 | |
|   webhooks: https://galaxy.ansible.com/api/v1/notifications/
 |