Merge branch 'master' into dj16
commit
34b9df63ff
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
mysqldump -h production.cboagmr25pjs.us-east-1.rds.amazonaws.com -u root --password=unglue1t --ignore-table=unglueit.core_key unglueit
|
|
@ -51,9 +51,8 @@ BrowserMatch "MSIE [2-6]" \
|
||||||
# MSIE 7 and newer should be able to use keepalive
|
# MSIE 7 and newer should be able to use keepalive
|
||||||
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
|
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/unglue.it-ssl-error.log
|
ErrorLog "|/usr/bin/cronolog /var/log/apache2/%Y%m%d_error.log"
|
||||||
LogLevel warn
|
LogLevel warn
|
||||||
CustomLog ${APACHE_LOG_DIR}/unglue.it-ssl-access.log combined
|
CustomLog "|/usr/bin/cronolog /var/log/apache2/%Y%m%d_access.log" combined
|
||||||
|
|
||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
|
@ -0,0 +1,3 @@
|
||||||
|
cd /opt/regluit
|
||||||
|
source ENV/bin/activate
|
||||||
|
export DJANGO_SETTINGS_MODULE=regluit.settings.just
|
|
@ -0,0 +1,3 @@
|
||||||
|
cd /opt/regluit
|
||||||
|
source ENV/bin/activate
|
||||||
|
export DJANGO_SETTINGS_MODULE=regluit.settings.please
|
|
@ -0,0 +1,3 @@
|
||||||
|
cd /opt/regluit
|
||||||
|
source ENV/bin/activate
|
||||||
|
export DJANGO_SETTINGS_MODULE=regluit.settings.prod
|
|
@ -14,6 +14,7 @@ WebTest==1.4.0
|
||||||
amqp==1.4.9
|
amqp==1.4.9
|
||||||
anyjson==0.3.3
|
anyjson==0.3.3
|
||||||
billiard==3.3.0.23
|
billiard==3.3.0.23
|
||||||
|
awscli==1.10.26
|
||||||
boto==2.8.0
|
boto==2.8.0
|
||||||
#git+ssh://git@github.com/Gluejar/boto.git@2.3.0
|
#git+ssh://git@github.com/Gluejar/boto.git@2.3.0
|
||||||
celery==3.1.23
|
celery==3.1.23
|
||||||
|
|
|
@ -188,6 +188,121 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.vm.define "prod" do |node|
|
||||||
|
|
||||||
|
node.vm.box = "ubuntu/trusty64"
|
||||||
|
node.vm.network "private_network", type: "dhcp"
|
||||||
|
#node.vm.network "private_network", ip: "192.168.33.10"
|
||||||
|
|
||||||
|
|
||||||
|
node.ssh.forward_agent = true
|
||||||
|
|
||||||
|
node.vm.provision 'ansible' do |ansible|
|
||||||
|
ansible.playbook = 'dev.yml'
|
||||||
|
ansible.verbose = "vv"
|
||||||
|
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
|
||||||
|
ansible.raw_arguments = [
|
||||||
|
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
|
||||||
|
"--limit=prod,127.0.0.1",
|
||||||
|
"-e vname=prod",
|
||||||
|
"-e class=prod",
|
||||||
|
"-e hostname=unglue.it",
|
||||||
|
"-e setdns=false",
|
||||||
|
"-e do_migrate=true",
|
||||||
|
"-e branch=production"
|
||||||
|
]
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
node.vm.provider "virtualbox" do |v|
|
||||||
|
v.memory = 1024
|
||||||
|
v.cpus = 2
|
||||||
|
end
|
||||||
|
|
||||||
|
node.vm.provider :aws do |aws, override|
|
||||||
|
aws.access_key_id = ENV['AWS_ACCESS_KEY_ID']
|
||||||
|
aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
|
||||||
|
|
||||||
|
aws.keypair_name = "ry-laptop"
|
||||||
|
|
||||||
|
# Ubuntu 12.04 LTS Precise / PV EBS-SSD boot
|
||||||
|
# alestic 2015.05.05
|
||||||
|
|
||||||
|
aws.instance_type="c1.medium"
|
||||||
|
|
||||||
|
aws.region = "us-east-1"
|
||||||
|
aws.availability_zone = "us-east-1c"
|
||||||
|
aws.ami = "ami-d8132bb0"
|
||||||
|
aws.security_groups = ["web-production"]
|
||||||
|
|
||||||
|
aws.tags = {
|
||||||
|
'Name' => 'prod_vagrant'
|
||||||
|
}
|
||||||
|
|
||||||
|
override.vm.box = "dummy"
|
||||||
|
override.ssh.username = "ubuntu"
|
||||||
|
override.ssh.private_key_path = "/Users/raymondyee/.ssh/id_rsa"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "prod2" do |node|
|
||||||
|
|
||||||
|
node.vm.box = "ubuntu/trusty64"
|
||||||
|
node.vm.network "private_network", type: "dhcp"
|
||||||
|
#node.vm.network "private_network", ip: "192.168.33.10"
|
||||||
|
|
||||||
|
|
||||||
|
node.ssh.forward_agent = true
|
||||||
|
|
||||||
|
node.vm.provision 'ansible' do |ansible|
|
||||||
|
ansible.playbook = 'dev.yml'
|
||||||
|
ansible.verbose = "vv"
|
||||||
|
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
|
||||||
|
ansible.raw_arguments = [
|
||||||
|
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
|
||||||
|
"--limit=prod,127.0.0.1",
|
||||||
|
"-e vname=prod",
|
||||||
|
"-e class=prod",
|
||||||
|
"-e hostname=unglue.it",
|
||||||
|
"-e setdns=false",
|
||||||
|
"-e do_migrate=true",
|
||||||
|
"-e branch=production"
|
||||||
|
]
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
node.vm.provider "virtualbox" do |v|
|
||||||
|
v.memory = 1024
|
||||||
|
v.cpus = 2
|
||||||
|
end
|
||||||
|
|
||||||
|
node.vm.provider :aws do |aws, override|
|
||||||
|
aws.access_key_id = ENV['AWS_ACCESS_KEY_ID']
|
||||||
|
aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
|
||||||
|
|
||||||
|
aws.keypair_name = "ry-laptop"
|
||||||
|
|
||||||
|
# Ubuntu 12.04 LTS Precise / PV EBS-SSD boot
|
||||||
|
# alestic 2015.05.05
|
||||||
|
|
||||||
|
aws.instance_type="c1.medium"
|
||||||
|
|
||||||
|
aws.region = "us-east-1"
|
||||||
|
aws.availability_zone = "us-east-1c"
|
||||||
|
aws.ami = "ami-d8132bb0"
|
||||||
|
aws.security_groups = ["web-production"]
|
||||||
|
|
||||||
|
aws.tags = {
|
||||||
|
'Name' => 'prod_vagrant'
|
||||||
|
}
|
||||||
|
|
||||||
|
override.vm.box = "dummy"
|
||||||
|
override.ssh.username = "ubuntu"
|
||||||
|
override.ssh.private_key_path = "/Users/raymondyee/.ssh/id_rsa"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
config.vm.define "localvm" do |node|
|
config.vm.define "localvm" do |node|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
|
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
|
||||||
target: '{{vname}}'
|
target: '{{vname}}'
|
||||||
dev_ssh_host: "{{ hostvars[target]['ansible_ssh_host'] }}"
|
dev_ssh_host: "{{ hostvars[target]['ansible_ssh_host'] }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: print dev_ssh_host
|
- name: print dev_ssh_host
|
||||||
|
@ -42,6 +41,7 @@
|
||||||
aws_access_key: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
|
aws_access_key: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
|
||||||
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
|
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
|
||||||
target: '{{vname}}'
|
target: '{{vname}}'
|
||||||
|
migrate: "{{do_migrate | default('true')}}"
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
args:
|
args:
|
||||||
github_auth_key: "{{github_auth_key}}"
|
github_auth_key: "{{github_auth_key}}"
|
||||||
repo_name: Gluejar/regluit
|
repo_name: Gluejar/regluit
|
||||||
key_name: "{{hostname}} {{ ansible_date_time.date }}"
|
key_name: "{{hostname}} {{ ansible_date_time.iso8601 }}"
|
||||||
key_path: /home/{{user}}/.ssh/id_rsa.pub
|
key_path: /home/{{user}}/.ssh/id_rsa.pub
|
||||||
|
|
||||||
- name: postfix install
|
- name: postfix install
|
||||||
|
@ -218,6 +218,8 @@
|
||||||
#run('django-admin.py syncdb --migrate --noinput --settings regluit.settings.please')
|
#run('django-admin.py syncdb --migrate --noinput --settings regluit.settings.please')
|
||||||
|
|
||||||
#Run syncdb on the application
|
#Run syncdb on the application
|
||||||
|
# TO DO: syncdb might be deprecated
|
||||||
|
# http://stackoverflow.com/a/29683785
|
||||||
|
|
||||||
- name: django syncdb
|
- name: django syncdb
|
||||||
django_manage: >
|
django_manage: >
|
||||||
|
@ -225,6 +227,7 @@
|
||||||
app_path=/opt/regluit/
|
app_path=/opt/regluit/
|
||||||
settings="regluit.settings.{{class}}"
|
settings="regluit.settings.{{class}}"
|
||||||
virtualenv=/opt/regluit/ENV
|
virtualenv=/opt/regluit/ENV
|
||||||
|
when: migrate
|
||||||
notify:
|
notify:
|
||||||
- restart apache2
|
- restart apache2
|
||||||
|
|
||||||
|
@ -234,6 +237,7 @@
|
||||||
app_path=/opt/regluit/
|
app_path=/opt/regluit/
|
||||||
settings="regluit.settings.{{class}}"
|
settings="regluit.settings.{{class}}"
|
||||||
virtualenv=/opt/regluit/ENV
|
virtualenv=/opt/regluit/ENV
|
||||||
|
when: migrate
|
||||||
notify:
|
notify:
|
||||||
- restart apache2
|
- restart apache2
|
||||||
|
|
||||||
|
@ -423,6 +427,16 @@
|
||||||
state=present
|
state=present
|
||||||
when: class in ['just']
|
when: class in ['just']
|
||||||
|
|
||||||
|
- name: set up script file to load environment for interactive use
|
||||||
|
command: cp "/opt/regluit/deploy/setup-{{class}}.sh" /home/{{user}}/setup.sh
|
||||||
|
|
||||||
|
- name: set up script to dump database
|
||||||
|
command: cp "/opt/regluit/deploy/dump_db_{{class}}.sh" /home/{{user}}/dump.sh
|
||||||
|
when: class in ['prod']
|
||||||
|
|
||||||
|
- name: put an empty file in main dir to help identify this instance
|
||||||
|
command: touch "/home/{{user}}/{{class}}_{{ ansible_date_time.iso8601 }}"
|
||||||
|
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart apache2
|
- name: restart apache2
|
||||||
|
|
Loading…
Reference in New Issue