Giter VIP home page Giter VIP logo

ansible-role-hostname's Introduction

Hostname

This is an ansible role to configure the hostname and initial /etc/hosts entries on a Debian-style system.

Role Variables

hostname_hostname: "{{inventory_hostname}}"

The host's primary FQDN.

hostname_shortname: "{{hostname_hostname.split('.')[0]}}"

The host's primary shortname, which by default is the local hostname with no domain parts.

hostname_ipaddress: "{{ansible_default_ipv4.address}}"

The host's primary IP address.

hostname_aliases: []

A list of any other hostname aliases you may want to assign this host.

hostname_othernames: []

A dict for setting up additional /etc/hosts entries. Each entry in the dict has an address element for the IP address and a hostnames element, which can be either a single string or a list of strings, representing one or more hostnames you want associated with that IP.

Example Playbook

- hosts: servers
  roles:
     - slaarti.hostname
  vars:
     hostname_aliases:
       - "testhost"
     hostname_othernames:
       - ipaddress: "127.1.1.1"
         hostnames:
           - "foo"
           - "bar"
       - ipaddress: "127.1.1.2"
         hostnames: "baz"

License

Unlicense; see the LICENSE file for details.

Author Information

Chris Pinard [email protected]

ansible-role-hostname's People

Contributors

slaarti avatar

Watchers

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