GithubHelp home page GithubHelp logo

m4wh6k / ansible-tailscale-inventory Goto Github PK

View Code? Open in Web Editor NEW
37.0 4.0 7.0 16 KB

Dynamic Ansible inventory for your Tailscale hosts

License: MIT License

Python 97.10% Makefile 2.90%
ansible ansible-inventory tailscale

ansible-tailscale-inventory's Introduction

ansible-tailscale-inventory

Dependency-free dynamic Ansible inventory for your Tailscale hosts. Allows you to reach your Tailscale hosts easily with Ansible. All you need is Tailscale installed and working, python 3.8+, and a copy of ansible_tailscale_inventory.py from this repo.

Usage

From one of your Tailscale nodes on your network, make ansible_tailscale_inventory.py available as an inventory to Ansible. This can be done as an argument to the -i option on Ansible commands, or by setting the ANSIBLE_INVENTORY environment variable's value as the path to the script.

Note: At the time of writing, the inventory script has been tested with macOS and Linux, but not Windows.

Ansible Groups

ansible_tailscale_inventory.py automatically provides a few groups.

  • There are groups of hosts for each operating system (macOS, linux, etc)
  • Online hosts are found in the online group, offline hosts in the offline group
  • The self group includes the local host
  • Each Tailscale tag that has at least one host will be a group as well. The name will be formatted as tag_TagName (dashes will be replace with underscores)

Inventory Metadata

The inventory automatically adds all available Tailscale IPs as a list in the fact tailscale_ips.

Contributing

Check out the contributing doc.

ansible-tailscale-inventory's People

Contributors

lucky1313 avatar m4wh6k avatar the-technat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ansible-tailscale-inventory's Issues

Have tests

We should have some basic automatic testing and linting with GitHub actions. This might require a little bit of refactoring to make it test-able

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.