Git Product home page Git Product logo

ansible-role-hosts's Introduction

Hosts

This role manages /etc/hosts and /etc/hostname. The files are managed with a template.

Role Variables

Each entry is described by a dictionary with the keys "address" which contains the IP address for the entry and "hosts" which is a list of hostnames. The host names are added in the same order so first one will be the canonical hostname.

The following describes what variables you can set. When "entry" is mentioned, it means the structure described in the last paragraph.

hosts_ipv4_loopback_hosts: An entry for the IPv4 loopback address. Defaults to setting localhost.localdomain and localhost as hostnames.

hosts_default_ipv4_hosts: An entry for default inventory IPv4 address. Defaults to inventory_hostname and inventory_hostname_short from ansible.

hosts_default_hosts: A list of entries that are set by default in the role. Contains the previous two entries by default.

hosts_additional_hosts: A list of additional entries to put in the hosts file. Empty by default.

hosts_all_hosts: List of all host entries. Just merges hosts_default_hosts and hosts_additional_hosts by default.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
  roles:
     - role: hosts
       hosts_additional_hosts:
           - address: 192.168.0.1
             hostnames:
                 - server.example.com
                 - server

License

MIT/Simplified BSD license

Author Information

Role created by Antti J. Salminen in 2014.

ansible-role-hosts's People

Contributors

ajsalminen avatar

Watchers

James Cloos 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.