Giter Site home page Giter Site logo

ansible-role-hetzner-key's Introduction

Travis (.org) branch Codecov Ansible Galaxy GitHub tag (latest by date) Ansible Galaxy Downloads

Ansible Role: Hetzner Key

An Ansible Role that manages Hetzner Robot Keys.

Prerequisites

Requirements

Name Type Version Location
ansible-filter Python package 1.0.1 Control node

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

hetzner_key_webservice_base_url: https://robot-ws.your-server.de

Base url that is pointing to the Hetzner Robot API. The variable is mostly utilized for testing purposes, there is no need to change the default.

hetzner_key_webservice_username: robot

Webservice login name. May be set/changed as described in the section Change Access Data (Hetzner Wiki).

hetzner_key_webservice_password: secret

Webservice password. May be set/changed as described in the section Change Access Data (Hetzner Wiki).

hetzner_key_instances:
  - name: New Key
    data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSkT3A1j89RT/540ghIMHXIVwNlAEM3WtmqVG7YN/wYwtsJ8iCszg4/lXQsfLFx\
    YmEVe8L9atgtMGCi5QdYPl4X/c+5YxFfm88Yjfx+2xEgUdOr864eaI22yaNMQ0AlyilmK+PcSyxKP4dzkf6B5Nsw8lhfB5n9F5md6GHLLjOG\
    uBbHYlesKJKnt2cMzzS90BdRk73qW6wJ+MCUWo+cyBFZVGOzrjJGEcHewOCbVs+IJWBFSi6w1enbKGc+RY9KrnzeDKWWqzYnNofiHGVFAuMx\
    rmZOasqlTIKiC2UK3RmLxZicWiQmPnpnjJRo7pL0oYM9r/sIWzD6i2S9szDy6aZ"

Keys may be managed by Ansible specifying them within hetzner_key_instances variable. Keys are referenced by the name attribute. Existing keys stored in the Hetzner Robot Key Management having different names will not be updated nor removed. All keys from the Hetzner Robot Key Management will be provisioned on the target hosts.

hetzner_key_instances:
  - name: New Key
    data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSkT3A1j89RT/540ghIMHXIVwNlAEM3WtmqVG7YN/wYwtsJ8iCszg4/lXQsfLFx\
    YmEVe8L9atgtMGCi5QdYPl4X/c+5YxFfm88Yjfx+2xEgUdOr864eaI22yaNMQ0AlyilmK+PcSyxKP4dzkf6B5Nsw8lhfB5n9F5md6GHLLjOG\
    uBbHYlesKJKnt2cMzzS90BdRk73qW6wJ+MCUWo+cyBFZVGOzrjJGEcHewOCbVs+IJWBFSi6w1enbKGc+RY9KrnzeDKWWqzYnNofiHGVFAuMx\
    rmZOasqlTIKiC2UK3RmLxZicWiQmPnpnjJRo7pL0oYM9r/sIWzD6i2S9szDy6aZ"
    state: absent

Add state: absent to remove the key from Hetzner Robot Key Management and the target hosts.

hetzner_key_webservice_concurrent_requests: 1
hetzner_key_webservice_concurrent_poll: 1

To speed up the role execution while handling the configuration for multiple keys, the number of parallel requests made to the Hetzner Robot API can be controlled by hetzner_key_webservice_concurrent_requests variable. The poll interval for asynchronous request result processing is set using hetzner_key_webservice_concurrent_poll. Check official documentation on Asynchronous Actions and Polling for more explanation.

Tags

Tags can be used to limit the role execution to a particular task module. Following tags are available:

  • hetzner_key,config: Covers the full role lifecycle.
  • hetzner_key_key: Manages access keys within Hetzner Robot Key Management.
  • hetzner_key_host: Configures access keys on the target hosts.

Dependencies

None.

Example Playbook

Since the role is managing the communication with the Hetzner Robot API only, it may be run on localhost.

- hosts: all
  roles:
     - nl2go.hetzner_key

Development

Use docker-molecule following the instructions to run Molecule or install Molecule locally (not recommended, version conflicts might appear).

Use following to run tests:

molecule test --all

This role relies on hetzner-robot-api-mock to simulate interactions with the Hetzner Robot API.

Maintainers

License

See the LICENSE.md file for details.

Author Information

This role was created by in 2019 by Newsletter2Go GmbH.

ansible-role-hetzner-key's People

Contributors

build-failure avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.