Giter Site home page Giter Site logo

chef-cookbook-hostname's Introduction

hostnames cookbook

Easy hostname, FQDN and /etc/hosts file updates. Less broken than the hostname recipe.

Works with custom /etc/hosts files and fixes aws dns slowness (use use_node_ip: true)

https://github.com/nathantsoi/chef-cookbook-hostname

Install it

With berkshelf - Berskfile

source 'https://supermarket.getchef.com'
...
cookbook 'hostnames'

Example

Run via a role - roles/base.rb

name 'base'
description 'Standard Sequoia setup'
run_list(
  'recipe[hostnames::default]',
  ...
)
default_attributes(
  set_fqdn: '*.sequoiacap.com',
  hostname_cookbook: {
    use_node_ip: true
  },
  ...
)

Attributes

  • node['set_fqdn'] - FQDN to set.

The asterisk character will be replaced with node.name. This way, you can add this to base role:

default_attributes :set_fqdn => '*.project-domain.com'

and have node set its FQDN and hostname based on its chef node name (which is provided on chef-client first run's command line).

  • node['hostname_cookbook']['use_node_ip'] -- when true sets the hostname to node["ipaddress"] in /etc/hosts (default: false)

  • node['hostname_cookbook']['hostsfile_ip'] -- IP used in /etc/hosts to correctly set FQDN (default: 127.0.1.1)

Recipes

  • hostnames::default -- will set node's FQDN to value of set_fqdn attribute, and hostname to its host part (up to first dot).

  • hostnames::vmware -- sets hostname automatically using vmtoolsd. You do not need to set node["set_fqdn"].

Contributing

  • Fork.

  • Make more awesome.

  • Pull request.

  • I will bump version and run: knife cookbook site share hostnames "Networking" -o ../

Author

(original) Maciej Pasternacki [email protected]

(current) Nathan [email protected]

chef-cookbook-hostname's People

Contributors

chulkilee avatar guilhem avatar jeanmertz avatar mattkasa avatar mpasternacki avatar nathantsoi avatar tily avatar timurb avatar xamebax avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.