sroegner / hostsfile-formula

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hostsfile

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

Available states

hostsfile

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

You must enable this function in /etc/salt/minion for the state to work:

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

hostsfile.hostname

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.

About

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

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


Languages

Language:SaltStack 100.0%