Giter Site home page Giter Site logo

ansible-hcloud-inventory's Introduction

ansible-hcloud-inventory

A dynamic inventory script for hetzner cloud.

Usage: HCLOUD_TOKEN=example ansible-playbook site.yml -u root -i hcloud.py or ansible-playbook site.yml -u root -i "hcloud.py cloud_token" or ansible-playbook site.yml -u root -i "hcloud.py @cloud_token.yml"

Token yaml file must contain 'hcloud_token' variable with token. This method allows that you use many of token or store token with vault.

Dependencies:

  • requests(apt install python-request or pip install -r requirements.txt)

The inventory will consist of multiple groups:

Name Description
all contains all hosts
hcloud contains all hosts in Hetzner Cloud
fsn1_dc8 contains all hosts in datacenter Falkenstein
nbg1_dc3 contains all hosts in datacenter Nürnberg
label1_value1 contains all hosts have label "label1"="value1"
label1_value2 contains all hosts have label "label1"="value2"

The host has the following hostvars:

Name Description
ansible_host Public or private IPv4 or IPv6 Address
ansible_public_net Public IPv4 Address
ansible_private_net Private IPv4 Address
hcloud_server_type Servertype eg. CX11
hcloud_image Name of the used image
hcloud_datacenter Datacenter the server is running in
hcloud_labels Instance labels

Check the hcloud.ini for a short explanation on how to use the ipv6 address of a server as or the private ip address of a server as value for ansible_host.

In hcloud.ini it is also possible to add aliases for the label groups created. So instead of DNS_true you can use dnsservers as group identifier.

ansible-hcloud-inventory's People

Contributors

hg8496 avatar slapsh avatar siwyd avatar dacrhu avatar ohdmax avatar gadelkareem avatar jqueuniet avatar myukselen avatar aft2d avatar 3cky avatar tutunak 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.