| Deletions are marked like this. | Additions are marked like this. |
| Line 10: | Line 10: |
| Line 12: | Line 13: |
| 1. Configure DNS names in the Puppet server: mgt.vh01.softxs.ch | 1. Configure new DNS names in the Puppet server mgt.vh01.softxs.ch. |
| Line 28: | Line 29: |
| Line 31: | Line 32: |
|
Make sure the new DNS name is defined on the all following DNS server: 1. zg-1.softxs.ch - Public server 1. zg-3.softxs.ch - Public server 1. loki.softxs.ch - LU DMZ 1. odin.softxs.ch - LU DMZ 1. modi.softxs.ch - LU Internal network = Setup Virtual Machine = == Configuration for Vagrant File Generation == |
1. Make sure the new DNS name is defined on the all following DNS server: 1. zg-1.softxs.ch - Public server 1. zg-3.softxs.ch - Public server 1. loki.softxs.ch - LU DMZ 1. odin.softxs.ch - LU DMZ 1. modi.softxs.ch - LU Internal network = Setup Virtual Machine & Virtual Host = 1. Define VM Vagrantfile generation 1. Define VM configuration 1. Define Virtual Host configuration 1. Start new VM 1. Log into VM and perform initial OS update and Puppet agent run 1. Setup SSH login certificate == Configuration for Vagrantfile Generation == 1. Configure the Vagrant generation in the Puppet server mgt.vh01.softxs.ch. {{{ ssh -p 10104 root@loki cd /etc/puppet/modules/manifests vi nodes.pp # Find the node definition for the host server (zg-1, loki, odin, etc.) # Add a v2:server::vm definition, similar to the following: node "zg-3.softxs.ch" { # host VM ... create_resources( v2_server::vm, { # VM definition ... 'v0402' => { vm_hostname => 'v0402', vm_fqdn => 'v0402.vh03.softxs.ch', vm_box => 'precise64_rails', vm_memory => 3072, vm_ip => '172.16.4.2', vm_netmask => '255.240.0.0', vm_ssh_port => 20402, vm_synched_folders => { 'vagrant' => { vm_dir => "/vagrant", host_dir => "." }, 'data' => { vm_dir => "/data", host_dir => "/v01/data/v0402", owner => "www-data", group => "v2", mount_options => ["dmode=775", "fmode=764"], }, 'backup' => { vm_dir => "/backup", host_dir => "/v01/backup/local/v0402", owner => "www-data", group => "v2", mount_options => ["dmode=775", "fmode=764"], }, }, }, ... }}} 1. The critical parameters are: (See [[V2VirtualServers]] for example configurations and the setup conventions) 1. Hostname 1. Fully qualified domain name (fqdn) 1. Virtual bas box 1. Memory 1. IP address 1. Port number 1. Paths for the /data & /backup directories 1. Wait for ''puppet agent'' to run on the host machine to generate the new Vagrantfile. 1. Or run it by hand: {{{ puppet agent --onetime --no-daemonize --verbose }}} 1. This will also create a new VM directory on the host machine: * /home/vagrant/vms/{name} Where ''name'' is the VM new host name 1. Register the new VM in the Wiki page: [[V2VirtualServers]] == Define a Puppet Node for the VM == 1. Define a new ''puppet node'' for the vm, named with the VM's fully qualified domain name: {{{ node "v0402.vh03.softxs.ch" { # VM FQDN class { 'puppet_agent': period => 10 } class { 'postfix_satellite': node_name => $name, mailname => 'softxs.ch', relayhost => 'smtp.softxs.ch' } include apache include www include mysql include passenger class { 'rails_user': user => 'v2' } # ..place for vhost definition (see next section).. } }}} == Define a Virtual Host on the VM == 1. Add an ''apache::vhost'' definition to the VM node: {{{ node "v0402.vh03.softxs.ch" { # VM node ... apache::vhost {'trial.softxs.ch': template => 'apache/vhost-v2.conf.erb', docroot => '/home/v2/rails/trial.softxs.ch', priority => 25, servername => 'trial.softxs.ch', options => '-Indexes', subvhosts => { 'trial1' => { }, 'trial2' => { }, }, ... } }}} 1. The ''subvhosts'' are used to define the relative paths for the individual applications |
| Line 45: | Line 151: |
|
== Initial System Software Update == == Configure Puppet Client == |
1. As user ''vagrant'' on the host machine start the VM: {{{ cd /home/vagrant/vms/{name} # Where 'name' is the new VM host name vagrant up # Starts the VM }}} 1. Log into the VM {{{ vagrant ssh }}} 1. Perform an initial software update on the VM {{{ su - apt-get update }}} 1. Perform an initial ''puppet agent'' run on the VM {{{ puppet agent --onetime --no-daemonize --verbose }}} 1. This should create a vhost, including 1. Apache configuration files 1. |
| Line 49: | Line 180: |
| = Setup Apache Virtual Host = |
1. In order to allow automatic login for application deployment, planc a {{{ ssh -p {port} v2@{host} }}} 1. Where * ''port'' is the SSH pot number defined in the VM's Vagrantfile * ''host'' is the base servers domain name 1. Create a .ssh directory. As user ''v2'' on the VM: {{{ cd ~ mkdir .ssh }}} |
| Line 56: | Line 202: |
V2 Deployment Checklist
Contents
- V2 Deployment Checklist
- Introduction
- DNS Name Configuration
- Setup Virtual Machine & Virtual Host
- Configure Reverse Proxy
- Setup Data Partition
- Setup V2 Deployment Instance
- Deploy Initial V2 System
- Start Delayed Job Task
- Register Application in MAPS
- Test Outgoing Email
- Configure & Test Incoming Email
- Install V2 Configuration
- Import Configuration
- Import Data & Documents
- End-to-End Test
- Setup Backups
- Setup Monitoring
Introduction
DNS Name Configuration
Configure DNS Names
- Configure new DNS names in the Puppet server mgt.vh01.softxs.ch.
ssh -p 10104 root@loki cd /etc/puppet/modules/bind9/files # -- Edit the following two files vi master/zones/all/{domain_name}. # Update the 'Serial' with today's date and the sequence number, normally '01'. :x vi master/generic/all/{domain_name}. # Add CNAME record for the sub-domain pointing to the host server :x
Test DNS Names
- Make sure the new DNS name is defined on the all following DNS server:
- zg-1.softxs.ch - Public server
- zg-3.softxs.ch - Public server
- loki.softxs.ch - LU DMZ
- odin.softxs.ch - LU DMZ
- modi.softxs.ch - LU Internal network
Setup Virtual Machine & Virtual Host
- Define VM Vagrantfile generation
- Define VM configuration
- Define Virtual Host configuration
- Start new VM
- Log into VM and perform initial OS update and Puppet agent run
- Setup SSH login certificate
Configuration for Vagrantfile Generation
- Configure the Vagrant generation in the Puppet server mgt.vh01.softxs.ch.
ssh -p 10104 root@loki cd /etc/puppet/modules/manifests vi nodes.pp # Find the node definition for the host server (zg-1, loki, odin, etc.) # Add a v2:server::vm definition, similar to the following: node "zg-3.softxs.ch" { # host VM ... create_resources( v2_server::vm, { # VM definition ... 'v0402' => { vm_hostname => 'v0402', vm_fqdn => 'v0402.vh03.softxs.ch', vm_box => 'precise64_rails', vm_memory => 3072, vm_ip => '172.16.4.2', vm_netmask => '255.240.0.0', vm_ssh_port => 20402, vm_synched_folders => { 'vagrant' => { vm_dir => "/vagrant", host_dir => "." }, 'data' => { vm_dir => "/data", host_dir => "/v01/data/v0402", owner => "www-data", group => "v2", mount_options => ["dmode=775", "fmode=764"], }, 'backup' => { vm_dir => "/backup", host_dir => "/v01/backup/local/v0402", owner => "www-data", group => "v2", mount_options => ["dmode=775", "fmode=764"], }, }, }, ...
The critical parameters are: (See V2VirtualServers for example configurations and the setup conventions)
- Hostname
- Fully qualified domain name (fqdn)
- Virtual bas box
- Memory
- IP address
- Port number
Paths for the /data & /backup directories
Wait for puppet agent to run on the host machine to generate the new Vagrantfile.
- Or run it by hand:
puppet agent --onetime --no-daemonize --verbose
- This will also create a new VM directory on the host machine:
- /home/vagrant/vms/{name}
Where name is the VM new host name
- /home/vagrant/vms/{name}
- Or run it by hand:
Register the new VM in the Wiki page: V2VirtualServers
Define a Puppet Node for the VM
Define a new puppet node for the vm, named with the VM's fully qualified domain name:
node "v0402.vh03.softxs.ch" { # VM FQDN class { 'puppet_agent': period => 10 } class { 'postfix_satellite': node_name => $name, mailname => 'softxs.ch', relayhost => 'smtp.softxs.ch' } include apache include www include mysql include passenger class { 'rails_user': user => 'v2' } # ..place for vhost definition (see next section).. }
Define a Virtual Host on the VM
Add an apache::vhost definition to the VM node:
node "v0402.vh03.softxs.ch" { # VM node ... apache::vhost {'trial.softxs.ch': template => 'apache/vhost-v2.conf.erb', docroot => '/home/v2/rails/trial.softxs.ch', priority => 25, servername => 'trial.softxs.ch', options => '-Indexes', subvhosts => { 'trial1' => { }, 'trial2' => { }, }, ... }
The subvhosts are used to define the relative paths for the individual applications
Start Virtual Machine
As user vagrant on the host machine start the VM:
cd /home/vagrant/vms/{name} # Where 'name' is the new VM host name vagrant up # Starts the VM
- Log into the VM
vagrant ssh
- Perform an initial software update on the VM
su - apt-get update
Perform an initial puppet agent run on the VM
puppet agent --onetime --no-daemonize --verbose
- This should create a vhost, including
- Apache configuration files
Setup V2 User SSH Certificate
- In order to allow automatic login for application deployment, planc a
ssh -p {port} v2@{host}- Where
port is the SSH pot number defined in the VM's Vagrantfile
host is the base servers domain name
Create a .ssh directory. As user v2 on the VM:
cd ~ mkdir .ssh
Configure Reverse Proxy
Setup Data Partition
Setup V2 Deployment Instance
deploy.rb
settings.local.yml
database.yml
Email Secret Key
Home Page Setup
Deploy Initial V2 System
Capistrano Deployment
Test Local Login
Test Invitation & MAPS Login
Start Delayed Job Task
Register Application in MAPS
Test Outgoing Email
Configure & Test Incoming Email
Install V2 Configuration
Import Configuration
Import Data & Documents
End-to-End Test
Setup Backups
