GithubHelp home page GithubHelp logo

abo-adapt / hostsfile-formula Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saltstack-formulas/hostsfile-formula

0.0 0.0 0.0 239 KB

Use minion IDs to keep /etc/hosts and hostnames consistent for clusters without DNS

Home Page: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html

SaltStack 100.00%

hostsfile-formula's Introduction

hostsfile

Formula to set up name resolution for all members of a salt cluster in /etc/hosts.

Available states

Uses the Salt Mine function network.ip_addrs to add minion ids and their regarding ips to the local hosts file.

At a minimum, you must enable the network.ip_addrs function in pillar or in /etc/salt/minion:

mine_functions:
  network.ip_addrs: []

The formula works best if the minion id is the fqdn and (if the machines have more than one interface) the desired interface to use for this is configured with the mine function:

mine_functions:
  network.interfaces: []
  network.ip_addrs:
    - eth1
mine_interval: 2

If you are already using network.ip_addrs for something else (perhaps another state that wants information on a different interface than hostsfile should use), you can specify a mine alias in pillar to query instead:

hostsfile:
alias: hostsfile_interface
mine_functions:
hostsfile_interface:
mine_function: network.ip_addrs iface: eth0

Also set and persist the hostname (again - using the minion id). This has so far been most useful on EC2 instances.

Works on RedHat/CentOS 5.X or RedHat/CentOS 6.X and Amazon OS - should also work on Ubuntu/Debian.

hostsfile-formula's People

Contributors

andrew-vant avatar gravyboat avatar iggy avatar nmadhok avatar samos123 avatar sroegner avatar tmandry avatar tomasfejfar avatar whiteinge 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.