lib/beaker/dsl/install_utils/pe_utils.rb
#Classify the master so that it can deploy frictionless packages for a given host.
# @param [Host] host The host to install pacakges for
# @api private
Classify the master so that it can deploy frictionless packages for a given host.
Classify the master so that it can deploy frictionless packages for a given host .
def deploy_frictionless_to_master(host)
          klass = host['platform'].gsub(/-/, '_').gsub(/\./,'')
          klass = "pe_repo::platform::#{klass}"
          if version_is_less(host['pe_ver'], '3.8')
            on dashboard, "cd /opt/puppet/share/puppet-dashboard && /opt/puppet/bin/bundle exec /opt/puppet/bin/rake nodeclass:add[#{klass},skip]"
            on dashboard, "cd /opt/puppet/share/puppet-dashboard && /opt/puppet/bin/bundle exec /opt/puppet/bin/rake node:add[#{master},,,skip]"
            on dashboard, "cd /opt/puppet/share/puppet-dashboard && /opt/puppet/bin/bundle exec /opt/puppet/bin/rake node:addclass[#{master},#{klass}]"
            on master, puppet("agent -t"), :acceptable_exit_codes => [0,2]
          else
            begin
              require 'scooter'
            rescue LoadError => e
              @logger.notify('WARNING: gem scooter is required for frictionless installation post 3.8')
              raise e
            end
            dispatcher = Scooter::HttpDispatchers::ConsoleDispatcher.new(dashboard)
            node_group = dispatcher.get_node_group_by_name('Beaker Frictionless Agent')
            if node_group.nil? || node_group.empty?
              node_group = {}
              node_group['name'] = "Beaker Frictionless Agent"
              node_group['rule'] = [ "and",  [ '=', 'name', master.to_s ]]
              node_group['classes'] ||= {}
            end
            node_group['classes'][klass] = {}
            dispatcher.create_new_node_group_model(node_group)
            on master, puppet("agent -t"), :acceptable_exit_codes => [0,2]
          end
        end
def deploy_frictionless_to_master ( host ) klass = host [ 'platform' ] . gsub ( / - / , '_' ) . gsub ( / \. / , '' ) klass = "pe_repo::platform::#{klass}" if version_is_less ( host [ 'pe_ver' ] , '3.8' ) on dashboard , "cd /opt/puppet/share/puppet-dashboard && /opt/puppet/bin/bundle exec /opt/puppet/bin/rake nodeclass:add[#{klass},skip]" on dashboard , "cd /opt/puppet/share/puppet-dashboard && /opt/puppet/bin/bundle exec /opt/puppet/bin/rake node:add[#{master},,,skip]" on dashboard , "cd /opt/puppet/share/puppet-dashboard && /opt/puppet/bin/bundle exec /opt/puppet/bin/rake node:addclass[#{master},#{klass}]" on master , puppet ( "agent -t" ) , :acceptable_exit_codes => [ 0 , 2 ] else begin require 'scooter' rescue LoadError => e @logger . notify ( 'WARNING: gem scooter is required for frictionless installation post 3.8' ) raise e end dispatcher = Scooter :: HttpDispatchers :: ConsoleDispatcher . new ( dashboard ) node_group = dispatcher . get_node_group_by_name ( 'Beaker Frictionless Agent' ) if node_group . nil? || node_group . empty? node_group = { } node_group [ 'name' ] = "Beaker Frictionless Agent" node_group [ 'rule' ] = [ "and" , [ '=' , 'name' , master . to_s ] ] node_group [ 'classes' ] ||= { } end node_group [ 'classes' ] [ klass ] = { } dispatcher . create_new_node_group_model ( node_group ) on master , puppet ( "agent -t" ) , :acceptable_exit_codes => [ 0 , 2 ] end end
Classify the master so that it can deploy frictionless packages for a given host.
Classify the master so that it can deploy frictionless packages for a given host .
# use the old rake tasks # the new hotness # Check if we've already created a frictionless agent node group # to avoid errors creating the same node group when the beaker hosts file contains # multiple hosts with the same platform # Pin the master to the node # add the pe_repo platform class
host
<not_specific>
<not_specific>
host The host to install pacakges for
host The host to install pacakges for
api
None