Git Product home page Git Product logo

ansible-hosts's Introduction

Ansible Role: hosts

license Ansible Role Ansible Role Ansible Quality Score GitHub release (latest SemVer) GitHub Workflow Status (branch)

Description

Ansible role that dynamically creates the hosts file.

Installation

ansible-galaxy install arillso.hosts

Requirements

None

Role Variables

hosts_file

Path to the host file on the target system.

hosts_file: /etc/hosts

hosts_backup

Backup the hosts file before changing it.

hosts_backup: false

hosts_group

Group owner of hosts file.

hosts_group: root

hosts_owner

Owner of hosts file.

hosts_owner: root

hosts_mode

Access permission hosts file.

hosts_mode: 0644

SELinux

Settings for SElinux.

hosts_serole: object_r
hosts_setype: net_conf_t
hosts_seuser: system_u
hosts_selevel: s0

Loopback

Creates a 127.0.0.1 entry for the server name.

hosts_hostname_loopback: true

Inventory

Inserts all hosts in the Ansible Inventory file into the Hosts file.

hosts_inventory_to_hosts: false

Optionally, hosts_aliases can be set in the host_vars, then it generates aliases for the hosts.

All Private

If this option and the hosts_inventory_to_hosts is enabled it writes all private ip addresses from the inventory into the hosts

hosts_all_private: true

All Public

If this option and the hosts_inventory_to_hosts is enabled it writes all public ip addresses from the inventory into the hosts.

hosts_all_public: false

IPv6

Ipv6 localhost entries are set automatically. Setting false it can be prevented.

hosts_ipv6: true

IPv4 address

Address that you would like to use as IPv4 address. This could be overriden by what you want.

hosts_ipv4_address: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"

hosts_exludes_interfaces

List of network cards that should not be added to the hosts file.

hosts_exludes_interfaces:
  - 'vet*'
  - 'docker'

Dependencies

None

Example Playbook

- hosts: all
  roles:
    - arillso.hosts

Author

License

This project is under the MIT License. See the LICENSE file for the full license text.

Copyright

(c) 2020, Arillso

ansible-hosts's People

Contributors

sbaerlocher avatar mleutenegger avatar mikevo avatar smutel avatar rnd42 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.