Configure /etc/hosts for each node

 @note f5 hosts are skipped since this isn't a valid step there

 @return [void]
 @api private
330398
def configure_hosts
      non_netdev_windows_hosts = @hosts.select{ |h| !(h['platform'] =~ /f5-|netscaler|windows/) }
      non_netdev_windows_hosts.each do |host|
        host_entries = non_netdev_windows_hosts.map do |h|
          h == host ? etc_hosts_entry(h, :private_ip) : etc_hosts_entry(h)
        end
        host_entries.unshift "127.0.0.1\tlocalhost localhost.localdomain\n"
        set_etc_hosts(host, host_entries.join(''))
      end
      nil
    end
188228
def host=(new_host)
      if new_host && !new_host.respond_to?(:to_str)
        raise TypeError, "Can't convert #{new_host.class} into String."
      end
      @host = new_host ? new_host.to_str : nil

      # Reset dependent values
      remove_instance_variable(:@authority) if defined?(@authority)
      remove_instance_variable(:@normalized_host) if defined?(@normalized_host)
      remove_composite_values

      # Ensure we haven't created an invalid URI
      validate()
    end
16705
def ensure_exposed(cidr)
      # configure new address
      # these will be added alongside any existing addresses
      if @executor_pool.expose(cidr)
        info "Exposed host node at cidr=#{cidr}"
      else
        error "Failed to expose host node at cidr=#{cidr}"
      end

      # cleanup any old addresses
      @executor_pool.ps('weave:expose') do |name, mac, *cidrs|
        cidrs.each do |exposed_cidr|
          if exposed_cidr != cidr
            warn "Migrating host node from cidr=#{exposed_cidr}"
            @executor_pool.hide(exposed_cidr)
          end
        end
      end
    end
1124679
def index
      @directories = Cmtool::Directory.roots

      respond_to do |format|
        format.html # index.html.erb
        format.xml  { render :xml => @directories }
      end
    end
176913
def on(hosts, options={}, &block)
      subset_copy = Marshal.dump(Configuration.env.filter(hosts))
      SSHKit::Coordinator.new(Marshal.load(subset_copy)).each(options, &block)
    end
903488
def add_tags
      @hosts.each do |host|
        instance = host['instance']

        # Define tags for the instance
        @logger.notify("aws-sdk: Add tags for #{host.name}")

        tags = [
          {
            :key   => 'jenkins_build_url',
            :value => @options[:jenkins_build_url],
          },
          {
            :key   => 'Name',
            :value => host.name,
          },
          {
            :key   => 'department',
            :value => @options[:department],
          },
          {
            :key   => 'project',
            :value => @options[:project],
          },
          {
            :key   => 'created_by',
            :value => @options[:created_by],
          },
        ]

        host[:host_tags].each do |name, val|
          tags << { :key => name.to_s, :value => val }
        end

        client.create_tags(
          :resources => [instance.instance_id],
          :tags      => tags.reject { |r| r[:value].nil? },
        )
      end

      nil
    end
145486
function(host, whitelist, next) {
    var blacklist = this.options.blacklist;
    helper.resolveHost(host, function(err, aRecords, resolvedHost) {
      var inBlacklist = false;
      if (!err) {
        if (whitelist) {
          if (_.intersection(aRecords, whitelist).length ) {
            next(err, [], aRecords);
            return;
          } else {
            for (var i = 0; i < whitelist.length; i++) {
              if (resolvedHost === whitelist[i]) {
                next(err, [], aRecords);
                return;
              }
            }
          }
        }

        inBlacklist = _.intersection(aRecords, blacklist)
      }
      next(err, inBlacklist, aRecords);
    });
  }
68633
def ssh_cleanup_known_hosts!(hosts=[host, public_ip])
      hosts = [hosts] unless hosts.respond_to? :each
      hosts.compact.each do |name|
        system_run "ssh-keygen -R %s" % name
      end
    end
162742
def all_hosts(self):
        """"""
        return set(imap(common.clean_node, itertools.chain(
            self._doc.get('hosts', []),
            self._doc.get('passives', []),
            self._doc.get('arbiters', []))))
1186156
def _apply_section_hosts(self, section, hosts):
        
        for entry in section['entries']:
            for hostname in self.expand_hostdef(entry['name']):
                if hostname not in hosts:
                    # Expanded host or child host or something else refers to a
                    # host that isn't actually defined. Ansible skips this, so
                    # we will too.
                    continue
                host = hosts[hostname]
                for var_key, var_val in entry['hostvars'].items():
                    host['hostvars'][var_key] = var_val
293003
def _route(self, attr, args, kwargs, **fkwargs):
        
        return self.cluster.hosts.keys()
593389
def prepare_vagrant(node)
      project_name = Bebox::Project.name_from_file(node.project_root)
      vagrant_box_base = Bebox::Project.vagrant_box_base_from_file(node.project_root)
      configure_local_hosts(project_name, node)
      add_vagrant_node(project_name, vagrant_box_base, node)
    end
551811
protected function normalizeHosts()
    {
        $connections = $this->config->get('database.redis-sentinel');

        if (! is_array($connections)) {
            return;
        }

        $this->config->set(
            'database.redis-sentinel',
            HostNormalizer::normalizeConnections($connections)
        );
    }
889337
function setIceServers()
    {
        if(stunServers)
        {
            for(var num = 0; num < stunServers.length; num++)
            {
                connConfig['iceServers'].push({'urls':'stun:'+stunServers[num]});   
            }
        }
    }
666175
def add_children(*nodes)
      new_children = nodes.flatten
      new_children.each do |node|
        node.set_parent self
        node.add_observer(self)
      end
      changed
      notify_observers :new_children, new_children
    end
203411
def install_configure_in(base)
      base.instance_eval <<-EOF
        # Configuration class for host module
        #
        #{base.name}::Configuration = Class.new(Configurations::Configuration)

        # The central configure method
        # @params [Proc] block the block to configure host module with
        # @raise [ArgumentError] error when not given a block
        # @example Configure a configuration
        #   MyGem.configure do |c|
        #     c.foo = :bar
        #   end
        #
        def self.configure(&block)
          semaphore.synchronize do
            fail ArgumentError, "configure needs a block" unless block_given?
            include_configuration_type!(#{base.name}::Configuration)

            set_configuration!(&block)
          end
        end

        # A reader for Configuration
        #
        def configuration
          semaphore.synchronize do
            return @configuration if @configuration

            if @configuration_defaults
              include_configuration_type!(#{base.name}::Configuration)
              set_configuration! { }
            end
          end
        end


        private

        # Sets the configuration instance variable
        #
        def self.set_configuration!(&block)
          @configuration = #{base.name}::Configuration.__new__(
                                                      configuration_options,
                                                      &block
                                                    )
        end

        @semaphore = Mutex.new
        def self.semaphore
          @semaphore
        end

      EOF
    end
320543
def linkify_hostgroups_hosts(self, hosts):
        
        for hostgroup in self:
            members = hostgroup.get_hosts()
            # The new members identifiers list
            new_members = []
            for member in members:
                # member is an host name
                member = member.strip()
                if not member:  # void entry, skip this
                    continue

                if member == '*':
                    # All the hosts identifiers list
                    new_members.extend(list(hosts.items.keys()))
                else:
                    host = hosts.find_by_name(member)
                    if host is not None:
                        new_members.append(host.uuid)
                        if hostgroup.uuid not in host.hostgroups:
                            host.hostgroups.append(hostgroup.uuid)
                    else:
                        hostgroup.add_unknown_members(member)

            # Make members unique
            new_members = list(set(new_members))

            # We find the id, we replace the names
            hostgroup.replace_members(new_members)