This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Added usage of "ansible-role-nginx", added interaction about installi…

…ng solr and/or varnish and configuring HTTP auth
  • Loading branch information...
BR0kEN- committed Mar 1, 2016
1 parent 6f8708b commit 442050d5bf8ab784a4a27ed1616bf87ddcb86083
Showing with 74 additions and 11 deletions.
  1. +43 −11 scripts/provision.yml
  2. +31 −0 scripts/vars/nginx.yml
@@ -7,26 +7,47 @@
- ../config.yml
- vars/php.yml
- vars/mysql.yml
- vars/nginx.yml
- vars/apache.yml

vars_prompt:
- name: solr
prompt: Do you want to install Solr? (yes/NO)
private: no

- name: varnish
prompt: Do you want to install Varnish? (yes/NO)
private: no

- name: http_auth_user
prompt: Username for HTTP authentication
default: admin
private: no
# WARNING!!! This condition will be processed only inside of Vagrantfile! The "vagrant"
# variable is undefined here and "when" construction aren't processed by Ansible for prompts.
when: not vagrant

- name: http_auth_pass
prompt: Passowrd for HTTP authentication
default: r3str1cteDHere
private: no
# WARNING!!! This condition will be processed only inside of Vagrantfile! The "vagrant"
# variable is undefined here and "when" construction aren't processed by Ansible for prompts.
when: not vagrant

vars:
vagrant: no
# Varnish configuration.
varnish_enabled: false
solr_enabled: false
# Use this secret in your client(Drupal Varnish module) in order to connect to Varnish.
# Use this secret in your client (Varnish module) in order to connect to Varnish.
varnish_secret: "14bac2e6-1e34-4770-8078-974373b76c90"
composer_packages:
drush/drush: 7.*
drupal/coder: dev-7.x-2.x
squizlabs/php_codesniffer: 1.5.6

cibox_protected_folders:
user: propeople
pass: givemebackup
list:
- "{{ webroot }}/cache"
- "{{ webroot }}/backup"
- path: "{{ webroot }}"
user: "{{ http_auth_user }}"
pass: "{{ http_auth_pass }}"

basic_packages:
- python
@@ -71,6 +92,13 @@
when: not vagrant
tags: ["always"]

- name: Process facts
set_fact:
extras:
solr: "{{ solr | bool }}"
varnish: "{{ varnish | bool }}"
tags: ["always"]

- name: Update APT cache
apt:
update_cache: yes
@@ -124,6 +152,10 @@
- role: cibox-misc
tags: ["misc"]

- role: ansible-role-nginx
tags: ["nginx", "php-stack"]
when: not vagrant

- role: ansible-role-apache
tags: ["apache", "php-stack"]

@@ -149,7 +181,7 @@
tags: ["mysql", "php-stack"]

- role: cibox-jetty-solr
when: solr_enabled
when: extras.solr
tags: ["solr", "php-stack"]

- role: cibox-sniffers
@@ -162,7 +194,7 @@
tags: ["ssl-config"]

- role: cibox-varnish
when: varnish_enabled
when: extras.varnish
tags: ["varnish"]

- role: ansible-role-memcached
@@ -0,0 +1,31 @@
---
nginx_configs:
upstream:
- upstream app_server {
server 127.0.0.1:8079 fail_timeout=0;
}

nginx_sites:
jenkins:
- listen 8080
- server_name jenkins.cibox
- location / {
auth_basic "Restricted area";
auth_basic_user_file /var/www/.htpasswd;

proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 90;

if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}

nginx_remove_sites:
- default

0 comments on commit 442050d

Please sign in to comment.