diff --git a/.gitignore b/.gitignore index f9936a7..7699c4c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ locale/*.mo locale/*/*.edit.po locale/*/*.po.time_stamp locale/*/*.pox +Dockerfile diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b0545fd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +language: ruby + +rvm: +- 2.6.3 + +branches: + only: + - master + +install: +- gem install bundler + +script: +- gem build foreman_gridscale.gemspec + +deploy: + provider: rubygems + api_key: $RUBYGEMS_APIKEY + gem: foreman_gridscale + gemspec: foreman_gridscale.gemspec diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e308cc..dd77a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,28 @@ # Changelog -## [v1.0.3] +## [v1.2.0] (Aug 29, 2019) + +- Fix IP-Selection (GH-1) +- Add MAC to model (GH-2/GH-3) +- Display IPv4/IPv6 in interface tab (GH-4) + +## [v1.0.3] (Apr 29, 2019) - Update descriptions and links after moving the repository to GitHub. -## [v1.0.2] +## [v1.0.2] (Feb 8, 2019) - Allowed creating host to choose isoimage which available in gridscale user account - Failover IPs are now correctly filtered out - Targeting a correct URL to open VNC for a regular user -## [v1.0.1] +## [v1.0.1] (Dec 5, 2018) - Decresed dependency to foreman 1.15 - Missing URL field in `_gridscale.html.erb` This url field is needed for creating compute resource in foreman 1.15. -## [v1.0.0] +## [v1.0.0] (Nov 20, 2018) - Initial release of foreman-gridscale diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0ad0650..b52fbca 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,3 +1,3 @@ * Aldemuro Haris * Wouter Wijsman - +* Ruben Schuller diff --git a/README.md b/README.md index 282db09..1dd49e2 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,6 @@ Go to Infrastructure > Compute resource and select the compute resource for grid * When creating a host, multiple network interfaces can be set to bootable. The gridscale platform does not support this, which is why only one of the interfaces will actually be set to bootable if this is the case * When creating a compute profile, the chosen network interface configuration is not saved * The Virtual Machines overview of a compute resource can take a long time to load -* The data shown in the VM tab of a host is not complete. More input about which information is useful is needed * Opening the console of a host in Foreman has not been implemented, but a link to gridscale is supplied * Acpi power off fails to shut down a system which did not boot -* MAC, IP4 and IP6 information is in the VM tab, not Interface diff --git a/app/helpers/gridscale_images_helper.rb b/app/helpers/gridscale_images_helper.rb index e7fbb97..3b70e5a 100644 --- a/app/helpers/gridscale_images_helper.rb +++ b/app/helpers/gridscale_images_helper.rb @@ -9,7 +9,7 @@ def gridscale_server_field(f) def select_ipv4(f, compute_resource) addresses = Array.new compute_resource.ips.each do |ip| - if ip.relations['servers'].empty? and ip.relations['loadbalancers'].empty? and ip.family ==4 and ip.failover = false + if ip.relations['servers'].empty? and ip.relations['loadbalancers'].empty? and ip.family ==4 and ip.failover == false addresses << ip end end @@ -29,7 +29,7 @@ def select_ipv4(f, compute_resource) def select_ipv6(f, compute_resource) addresses = Array.new compute_resource.ips.each do |ip| - if ip.relations['servers'].empty? and ip.relations['loadbalancers'].empty? and ip.family ==6 and ip.failover = false + if ip.relations['servers'].empty? and ip.relations['loadbalancers'].empty? and ip.family ==6 and ip.failover == false addresses << ip end end diff --git a/app/models/concerns/fog_extensions/gridscale/server.rb b/app/models/concerns/fog_extensions/gridscale/server.rb index 6491769..091a89f 100644 --- a/app/models/concerns/fog_extensions/gridscale/server.rb +++ b/app/models/concerns/fog_extensions/gridscale/server.rb @@ -4,6 +4,8 @@ module Server extend ActiveSupport::Concern attr_accessor :object_uuid, :mac, :server_uuid, :interfaces_attributes, :ipv4_address, :ipv6_address + alias_attribute :ip, :ipv4_address + alias_attribute :ip6, :ipv6_address def state requires :status @@ -57,7 +59,10 @@ def mac_addr :mac end - + def select_nic(fog_nics, nic) + # foreman-xenserver uses fog_nics[0] here, so I'll just copy that for now. + fog_nics[0] + end end end end diff --git a/app/models/foreman_gridscale/gridscale.rb b/app/models/foreman_gridscale/gridscale.rb index 6593203..2089f7d 100644 --- a/app/models/foreman_gridscale/gridscale.rb +++ b/app/models/foreman_gridscale/gridscale.rb @@ -35,7 +35,7 @@ def to_label end def provided_attributes - super.merge({}) + super.merge({:mac => :mac}) end def get_ip(ipaddr_uuid) diff --git a/lib/foreman_gridscale/version.rb b/lib/foreman_gridscale/version.rb index b864c64..9400154 100644 --- a/lib/foreman_gridscale/version.rb +++ b/lib/foreman_gridscale/version.rb @@ -1,3 +1,3 @@ module ForemanGridscale - VERSION = '1.0.3'.freeze + VERSION = '1.2.0'.freeze end