foreman_digitalocean 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/app/models/foreman_digitalocean/digitalocean.rb +1 -4
- data/app/views/compute_resources/form/_digitalocean.html.erb +3 -5
- data/lib/foreman_digitalocean/engine.rb +1 -0
- data/lib/foreman_digitalocean/tasks/test.rake +1 -0
- data/lib/foreman_digitalocean/version.rb +1 -1
- data/test/unit/foreman_digitalocean/digitalocean_test.rb +11 -12
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40e7592a3281e8c3a309dea6de05fe97d6e38625
|
4
|
+
data.tar.gz: 84c63f6d23de034071ee0fb632cbbed358eb18cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 441f829ee9a1642edfc3144000aa71ae7046ac903915a266dd6d075ee7ec1cbaeb0cd5bb76ea3b1b7700b0e45862fc88927ef3280b87eb6d7ca50091b7f9025f
|
7
|
+
data.tar.gz: 6e35c6b39759de2a4ac1bdfb3ebcfb346a55f767e3a4cfdb0e2b5a333bdf9ccbc0ea56e15c911993df395baa112cc1fc91f43970337663adf391cda8dfc6d3a3
|
data/README.md
CHANGED
@@ -52,12 +52,14 @@ To verify that the installation was successful, go to Foreman, top bar **Adminis
|
|
52
52
|
| --------------- | --------------:|
|
53
53
|
| <= 1.7.x | ~> 0.1.x |
|
54
54
|
| >= 1.8.0 | ~> 0.2.x |
|
55
|
+
| >= 1.11.0 | ~> 1.x |
|
56
|
+
| >= 1.13.0 | ~> 1.1 |
|
55
57
|
|
56
58
|
## Configuration
|
57
59
|
|
58
60
|
Go to **Infrastructure > Compute Resources** and click on "New Compute Resource".
|
59
61
|
|
60
|
-
Choose the **DigitalOcean provider**, and fill in all the fields.
|
62
|
+
Choose the **DigitalOcean provider**, and fill in all the fields. You need an API token with read and write access, which can be created at the [DigitalOcean API section](https://cloud.digitalocean.com/settings/api/tokens). It will be encrypted in the database.
|
61
63
|
|
62
64
|
That's it. You're now ready to create and manage droplets in your new DigitalOcean compute resource.
|
63
65
|
|
@@ -12,8 +12,6 @@ module ForemanDigitalocean
|
|
12
12
|
after_create :setup_key_pair
|
13
13
|
after_destroy :destroy_key_pair
|
14
14
|
|
15
|
-
attr_accessible :region, :api_key
|
16
|
-
|
17
15
|
def to_label
|
18
16
|
"#{name} (#{provider_friendly_name})"
|
19
17
|
end
|
@@ -79,8 +77,7 @@ module ForemanDigitalocean
|
|
79
77
|
end
|
80
78
|
|
81
79
|
def associated_host(vm)
|
82
|
-
|
83
|
-
where(:ip => [vm.public_ip_address, vm.private_ip_address]).first
|
80
|
+
associate_by("ip", [vm.public_ip_address])
|
84
81
|
end
|
85
82
|
|
86
83
|
def user_data_supported?
|
@@ -1,14 +1,12 @@
|
|
1
|
-
<%= password_f f, :
|
1
|
+
<%= password_f f, :password, :label => _("API Key"), :unset => unset_password? %>
|
2
2
|
<% regions = f.object.regions rescue [] %>
|
3
3
|
|
4
4
|
<div id='region_selection'>
|
5
|
-
<%=
|
6
|
-
f, :region, regions, :slug, :name, {},
|
5
|
+
<%= selectable_f(f, :region, regions.map(&:slug), {},
|
7
6
|
:label => _('Default Region'), :disabled => regions.empty?,
|
8
7
|
:help_inline => link_to_function(
|
9
8
|
regions.empty? ? _("Load Regions") : _("Test Connection"), "testConnection(this)",
|
10
9
|
:class => "btn + #{regions.empty? ? "btn-default" : "btn-success"}",
|
11
10
|
:'data-url' => test_connection_compute_resources_path) +
|
12
|
-
|
13
|
-
:class => 'hide').html_safe) %>
|
11
|
+
hidden_spinner('', :id => 'test_connection_indicator').html_safe) %>
|
14
12
|
</div>
|
@@ -1,18 +1,17 @@
|
|
1
1
|
require 'test_plugin_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
should delegate_method(:flavors).to(:client)
|
8
|
-
should have_one(:key_pair)
|
3
|
+
module ForemanDigitalocean
|
4
|
+
class DigitaloceanTest < ActiveSupport::TestCase
|
5
|
+
should validate_presence_of(:api_key)
|
6
|
+
should have_one(:key_pair)
|
9
7
|
|
10
|
-
|
11
|
-
|
8
|
+
setup { Fog.mock! }
|
9
|
+
teardown { Fog.unmock! }
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
test 'ssh key pair gets created after its saved' do
|
12
|
+
digitalocean = FactoryGirl.build(:digitalocean_cr)
|
13
|
+
digitalocean.expects(:setup_key_pair)
|
14
|
+
digitalocean.save
|
15
|
+
end
|
17
16
|
end
|
18
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_digitalocean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommy McNeely, Daniel Lobato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.42'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.42'
|
27
27
|
description: Provision and manage DigitalOcean droplets from Foreman.
|
28
28
|
email:
|
29
29
|
- elobatocs@gmail.com
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
76
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.
|
77
|
+
rubygems_version: 2.5.0
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: Provision and manage DigitalOcean droplets from Foreman
|