avst-cloud 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,137 @@
1
+ ---
2
+
3
+ prefixes:
4
+ - "example_"
5
+
6
+ classes:
7
+ - baseusers
8
+ - packages_repos
9
+ - noconfigpkgs
10
+ - noconfigpkgs::git
11
+
12
+ dependencies:
13
+ - baseusers
14
+ - packages_repos
15
+ - noconfigpkgs
16
+ - apt
17
+ - yum
18
+ - puppi
19
+ - stdlib
20
+
21
+
22
+ # install packages
23
+ noconfigpkgs::default_packages:
24
+ RedHat:
25
+ - 'passwd'
26
+ - 'acl'
27
+ - 'diffutils'
28
+ - 'traceroute'
29
+ - 'sysstat'
30
+ - 'mailx'
31
+ - 'mtr'
32
+ - 'vim-enhanced'
33
+ - 'screen'
34
+ - 'wget'
35
+ - 'curl'
36
+ - 'unzip'
37
+ - 'tar'
38
+ - 'cyrus-sasl-plain'
39
+ - 'zsh'
40
+ Debian:
41
+ - 'zsh'
42
+ - 'sysstat'
43
+ - 'atop'
44
+ - 'at'
45
+ - 'vim'
46
+ - 'screen'
47
+ - 'wget'
48
+ - 'curl'
49
+ - 'unzip'
50
+ - 'tar'
51
+
52
+ # Create users
53
+ baseusers::users :
54
+ atlassian :
55
+ name : 'atlassian'
56
+ home : '/home/atlassian'
57
+ shell : '/bin/bash'
58
+ gid : 1010
59
+ uid : 1010
60
+ comment : 'atlassian User'
61
+ password : '*'
62
+
63
+ # create groups
64
+ baseusers::groups:
65
+ hosting :
66
+ name : 'atlassian'
67
+ gid : 1010
68
+
69
+ # create apt/yum repositories
70
+ packages_repos::repos:
71
+ Debian:
72
+ bintraybintray-adaptavist-deb:
73
+ location: 'https://dl.bintray.com/adaptavist/ubuntu/'
74
+ repos: '/dists/ubuntu/main/binary-amd64/'
75
+ include_src: false
76
+ release: ''
77
+ key: '8756C4F765C9AC3CB6B85D62379CE192D401AB61'
78
+ key_content: |
79
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
80
+ Version: GnuPG v1
81
+
82
+ mQIN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Hat:
132
+ bintraybintray-adaptavist-rpm:
133
+ baseurl: 'https://dl.bintray.com/adaptavist/rpm'
134
+ descr: "adaptavist avst-app repository"
135
+ enabled: 1
136
+ gpgcheck: 0
137
+ priority: 1
data/config/deploy.rb ADDED
@@ -0,0 +1,79 @@
1
+
2
+ lock '3.2.1'
3
+
4
+ set :application, 'my_app_name'
5
+ set :repo_url, ENV["cap_git_repo_url"]
6
+ set :branch, ENV["cap_reference_name"] || ENV["cap_branch_name"] || "master"
7
+
8
+ # Default branch is :master
9
+ # ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
10
+
11
+ # Default deploy_to directory is /var/www/my_app
12
+ set :deploy_to, ENV["destination_folder"]
13
+
14
+ # Default value for :scm is :git
15
+ set :scm, :git
16
+
17
+ # Default value for :format is :pretty
18
+ set :format, :pretty
19
+
20
+ # Default value for :log_level is :debug
21
+ # set :log_level, :debug
22
+
23
+ # Default value for :pty is false
24
+ set :pty, true
25
+
26
+ # Default value for :linked_files is []
27
+ # set :linked_files, %w{config/database.yml}
28
+
29
+ # Default value for linked_dirs is []
30
+ # set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
31
+ # set :use_sudo, true
32
+ # set :pty, true
33
+ # default_run_options[:pty] = true
34
+
35
+ set :ssh_options, {
36
+ forward_agent: false,
37
+ keys: [ENV["cap_access_password"]]
38
+ }
39
+
40
+ server ENV["cap_ip_address"], user: ENV["cap_access_user"], port: 22, password: ENV["cap_access_password"], roles: %w{app}
41
+
42
+ # Default value for default_env is {}
43
+ # set :default_env, { path: "/usr/local/rvm/rubies/ruby-2.1.2/bin/:/usr/local/rvm/gems/ruby-2.1.2/bin/:$PATH" }
44
+
45
+ # Default value for keep_releases is 5
46
+ set :keep_releases, 50000
47
+
48
+ after 'deploy', 'prepare_puppet_and_execute'
49
+
50
+ set :default_env, {
51
+ 'PATH' => "/usr/local/rvm/gems/ruby-2.0.0-p481/bin:/usr/local/rvm/gems/ruby-2.0.0-p481@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p481/bin:/usr/local/rvm/bin:$PATH",
52
+ 'RUBY_VERSION' => '2.0.0',
53
+ 'GEM_HOME' => '/usr/local/rvm/gems/ruby-2.0.0-p481',
54
+ 'GEM_PATH' => '/usr/local/rvm/gems/ruby-2.0.0-p481',
55
+ # 'BUNDLE_PATH' => '/path/to/.rvm/gems/ree-1.8.7-2010.01' # If you are using bundler.
56
+ }
57
+
58
+ namespace :deploy do
59
+
60
+ desc 'Restart application'
61
+ task :restart do
62
+ on roles(:app), in: :sequence, wait: 5 do
63
+ # Your restart mechanism here, for example:
64
+ # execute :touch, release_path.join('tmp/restart.txt')
65
+ end
66
+ end
67
+
68
+ after :publishing, :restart
69
+
70
+ after :restart, :clear_cache do
71
+ on roles(:web), in: :groups, limit: 3, wait: 10 do
72
+ # Here we can do anything such as:
73
+ # within release_path do
74
+ # execute :rake, 'cache:clear'
75
+ # end
76
+ end
77
+ end
78
+
79
+ end
@@ -0,0 +1,48 @@
1
+ # Simple Role Syntax
2
+ # ==================
3
+ # Supports bulk-adding hosts to roles, the primary server in each group
4
+ # is considered to be the first unless any hosts have the primary
5
+ # property set. Don't declare `role :all`, it's a meta role.
6
+
7
+ # role :app, %w{example.com}
8
+
9
+
10
+ # Extended Server Syntax
11
+ # ======================
12
+ # This can be used to drop a more detailed server definition into the
13
+ # server list. The second argument is a, or duck-types, Hash and is
14
+ # used to set extended properties on the server.
15
+
16
+ # server '178.250.52.77', user: 'root', roles: %w{app}, my_property: :my_value
17
+ # set :password, ask('Server password', nil)
18
+ # # fetch(:password)
19
+ # server '178.250.53.87', user: 'root', port: 22, password: '***REMOVED***', roles: %w{app}
20
+
21
+ # set :rvm_type, :system # Defaults to: :auto
22
+ # set :rvm_ruby_version, '2.1.2p95' # Defaults to: 'default'
23
+
24
+ # Custom SSH Options
25
+ # ==================
26
+ # You may pass any option but keep in mind that net/ssh understands a
27
+ # limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
28
+ #
29
+ # Global options
30
+ # --------------
31
+ # set :ssh_options, {
32
+ # keys: %w(/home/rlisowski/.ssh/id_rsa),
33
+ # forward_agent: false,
34
+ # auth_methods: %w(password)
35
+ # }
36
+ #
37
+ # And/or per server (overrides global)
38
+ # ------------------------------------
39
+ # server 'example.com',
40
+ # user: 'user_name',
41
+ # roles: %w{web app},
42
+ # ssh_options: {
43
+ # user: 'user_name', # overrides user setting above
44
+ # keys: %w(/home/user_name/.ssh/id_rsa),
45
+ # forward_agent: false,
46
+ # auth_methods: %w(publickey password)
47
+ # # password: 'please use keys'
48
+ # }
data/lib/avst-cloud.rb ADDED
@@ -0,0 +1,28 @@
1
+ # Copyright 2015 Adaptavist.com Ltd.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require_relative './avst-cloud/aws_connection.rb'
16
+ require_relative './avst-cloud/aws_server.rb'
17
+ require_relative './avst-cloud/rackspace_connection.rb'
18
+ require_relative './avst-cloud/rackspace_server.rb'
19
+ require_relative './avst-cloud/logging.rb'
20
+ require 'fog'
21
+ require 'net/ssh'
22
+ require 'net/scp'
23
+ require 'uri'
24
+ require 'colorize'
25
+
26
+ module AvstCloud
27
+
28
+ end
@@ -0,0 +1,203 @@
1
+ # Copyright 2015 Adaptavist.com Ltd.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require_relative './cloud_connection.rb'
16
+
17
+ module AvstCloud
18
+
19
+ class AwsConnection < AvstCloud::CloudConnection
20
+
21
+ attr_accessor :region
22
+
23
+ def initialize(provider_user, provider_pass, region)
24
+ super('aws', provider_user, provider_pass)
25
+ @region = region
26
+ end
27
+
28
+ def server(server_name, root_user, root_password, os=nil)
29
+ server = find_fog_server(server_name)
30
+ if !root_user and os
31
+ root_user = user_from_os(os)
32
+ end
33
+ AvstCloud::AwsServer.new(server, server_name, server.public_ip_address, root_user, root_password)
34
+ end
35
+
36
+ def create_server(server_name, flavour, os, key_name, ssh_key, subnet_id, security_group_ids, ebs_size, hdd_device_path, ami_image_id, availability_zone)
37
+
38
+ # Permit named instances from DEFAULT_FLAVOURS
39
+ flavour = flavour || "t2.micro"
40
+ os = os || "ubuntu-14"
41
+ ami_image_id = ami_image_id || "ami-f0b11187"
42
+ device_name = hdd_device_path || '/dev/sda1'
43
+
44
+ root_user = user_from_os(os)
45
+ unless File.file?(ssh_key)
46
+ logger.error "Could not find local SSH key '#{ssh_key}'".red
47
+ raise "Could not find local SSH key '#{ssh_key}'"
48
+ end
49
+
50
+ existing_servers = all_named_servers(server_name)
51
+ restartable_servers = existing_servers.select{ |serv| serv.state == 'stopped' }
52
+ running_servers = existing_servers.select{ |serv| serv.state != 'stopped' && serv.state != 'terminated' }
53
+
54
+ if running_servers.length > 0
55
+ running_servers.each do |server|
56
+ logger.error "Server #{server_name} with id #{server.id} found in state: #{server.state}".yellow
57
+ end
58
+ raise "Server with the same name found!"
59
+
60
+ elsif restartable_servers.length > 0
61
+ if restartable_servers.length > 1
62
+ running_servers.each do |server|
63
+ logger.error "Server #{server_name} with id #{server.id} found in state: #{server.state}. Can not restart".yellow
64
+ end
65
+ raise "Too many servers can be restarted."
66
+ end
67
+ server = restartable_servers.first
68
+ server.start
69
+ result_server = AvstCloud::AwsServer.new(server, server_name, server.public_ip_address, root_user, ssh_key)
70
+ result_server.wait_for_state() {|serv| serv.ready?}
71
+ logger.debug "[DONE]\n\n"
72
+ logger.debug "The server was successfully re-started.\n\n"
73
+ result_server
74
+ else
75
+ logger.debug "Creating EC2 server:"
76
+ logger.debug "Server name - #{server_name}"
77
+ logger.debug "Operating system - #{os}"
78
+ logger.debug "image_template_id - #{ami_image_id}"
79
+ logger.debug "flavour - #{flavour}"
80
+ logger.debug "key_name - #{key_name}"
81
+ logger.debug "ssh_key - #{ssh_key}"
82
+ logger.debug "subnet_id - #{subnet_id}"
83
+ logger.debug "security_group_ids - #{security_group_ids}"
84
+ logger.debug "region - #{@region}"
85
+ logger.debug "availability_zone - #{availability_zone}"
86
+ logger.debug "ebs_size - #{ebs_size}"
87
+ logger.debug "hdd_device_path - #{device_name}"
88
+
89
+ create_ebs_volume = nil
90
+ if ebs_size
91
+ # in case of centos ami we need to use /dev/xvda this is ami dependent
92
+ create_ebs_volume = [
93
+ {
94
+ :DeviceName => device_name,
95
+ 'Ebs.VolumeType' => 'gp2',
96
+ 'Ebs.VolumeSize' => ebs_size,
97
+ }
98
+ ]
99
+ end
100
+
101
+ # create server
102
+ server = connect.servers.create :tags => {
103
+ 'Name' => server_name,
104
+ 'os' => os
105
+ },
106
+ :flavor_id => flavour,
107
+ :image_id => ami_image_id,
108
+ :key_name => key_name,
109
+ :subnet_id => subnet_id,
110
+ :associate_public_ip => true,
111
+ :security_group_ids => security_group_ids,
112
+ :availability_zone => availability_zone,
113
+ :block_device_mapping => create_ebs_volume
114
+
115
+ result_server = AvstCloud::AwsServer.new(server, server_name, nil, root_user, ssh_key)
116
+ # result_server.logger = logger
117
+ # Check every 5 seconds to see if server is in the active state (ready?).
118
+ # If the server has not been built in 5 minutes (600 seconds) an exception will be raised.
119
+ result_server.wait_for_state() {|serv| serv.ready?}
120
+
121
+ logger.debug "[DONE]\n\n"
122
+
123
+ logger.debug "The server has been successfully created, to login onto the server:\n"
124
+ logger.debug "\t ssh -i #{ssh_key} #{root_user}@#{server.public_ip_address}\n"
125
+
126
+ result_server.ip_address = server.public_ip_address
127
+ result_server
128
+ end
129
+ end
130
+
131
+ def server_status(server_name)
132
+ servers = all_named_servers(server_name).select{|serv| serv.state != 'terminated'}
133
+ if servers.length > 0
134
+ servers.each do |server|
135
+ logger.debug "Server #{server.id} with name '#{server_name}' exists and has state: #{server.state}"
136
+ end
137
+ else
138
+ logger.debug "Server not found for name: #{server_name}"
139
+ end
140
+ end
141
+
142
+ def list_flavours
143
+ connect.flavors.each do |fl|
144
+ logger.debug fl.inspect
145
+ end
146
+ end
147
+
148
+ def list_images
149
+ connect.images.each do |im|
150
+ logger.debug im.inspect
151
+ end
152
+ end
153
+
154
+ # Returns list of servers from fog
155
+ def list_known_servers
156
+ connect.servers.all
157
+ end
158
+
159
+ def find_fog_server(server_name, should_fail=true)
160
+ servers = all_named_servers(server_name).select{|serv| serv.state != 'terminated'}
161
+ unless servers.length == 1
162
+ logger.debug "Found #{servers.length} servers for name: #{server_name}".yellow
163
+ if should_fail
164
+ raise "Found #{servers.length} servers for name: #{server_name}"
165
+ end
166
+ end
167
+ servers.first
168
+ end
169
+
170
+ private
171
+ def user_from_os(os)
172
+ case os.to_s
173
+ when /^ubuntu/
174
+ user = "ubuntu"
175
+ when /^debian/
176
+ user = "admin"
177
+ when /^centos/
178
+ user = "ec2-user"
179
+ when /^redhat/
180
+ user = "ec2-user"
181
+ else
182
+ user = "root"
183
+ end
184
+ user
185
+ end
186
+ def connect
187
+ unless @connection
188
+ logger.debug "Creating new connection to AWS"
189
+ @connection = Fog::Compute.new({
190
+ :provider => 'AWS',
191
+ :region => @region,
192
+ :aws_access_key_id => @provider_access_user,
193
+ :aws_secret_access_key => @provider_access_pass
194
+ })
195
+ end
196
+ @connection
197
+ end
198
+
199
+ def all_named_servers(server_name)
200
+ connect.servers.all({'tag:Name' => server_name})
201
+ end
202
+ end
203
+ end