Code Monkey home page Code Monkey logo

ansible-collection-maas's Introduction

ansible-collection-maas

Ansible collection of modules to use in IaC management of MAAS-managed infrastructure.

Requires the python-libmaas library to be installed on the Ansible control node.

Modules

set_hostname

Description: Sets the hostname for a machine in MaaS from a given device ID

Options:

    hostname:
        description: Hostname to be set.
        required: true
        type: str
    system_id:
        description: The system_id of the machine to be configured.
        required: true
        type: str
    maas_url:
        description: The URL of the MaaS server. Can use MAAS_URL environment variable instead.
        required: false
        type: str
    maas_apikey:
        description: The API Key for authentication to the MaaS server. Can use MAAS_APIKEY environment variable instead.
        required: false
        type: str

Examples:

# Set the hostname
- name: Set the hostname
  tomkivlin.maas.set_hostname:
    hostname: server1
    system_id: y3b3x3
    maas_url: http://maas_server:5240/MAAS/
    maas_apikey: fsdfsdfsdf:sdfsdfsdf:sdfsdfsdf

# Set the hostname, using environment variables for the URL and API key
- name: Test with a message and changed output
  tomkivlin.maas.set_hostname:
    hostname: server1
    system_id: y3b3x3

get_machine

Description: Gets all info about a machine in MaaS from the system_id or hostname

Options:

    hostname:
        description: Hostname of the machine.
        required: false
        type: str
    system_id:
        description: The system_id of the machine.
        required: false
        type: str
    maas_url:
        description: The URL of the MaaS server. Can use MAAS_URL environment variable instead.
        required: false
        type: str
    maas_apikey:
        description: The API Key for authentication to the MaaS server. Can use MAAS_APIKEY environment variable instead.
        required: false
        type: str

Examples:

# Get information based on the hostname
- name: Get information based on the hostname
  tomkivlin.maas.get_machine:
    hostname: server1
    maas_url: http://maas_server:5240/MAAS/
    maas_apikey: fsdfsdfsdf:sdfsdfsdf:sdfsdfsdf

# Get information based on the system_id
- name: Get information based on the system_id
  tomkivlin.maas.get_machine:
    system_id: y3b3x3
    maas_url: http://maas_server:5240/MAAS/
    maas_apikey: fsdfsdfsdf:sdfsdfsdf:sdfsdfsdf

get_system_id

Description: Gets system_id from hostname or power_address

Options:

    hostname:
        description: The hostname of the machine. If not included, power_address must be used.
        required: false
        type: str
    power_address:
        description: The power_address of the machine (e.g. BMC, iLo, iDRAC). If not included, hostname must be used.
        required: false
        type: str
    maas_url:
        description: The URL of the MaaS server. Can use MAAS_URL environment variable instead.
        required: false
        type: str
    maas_apikey:
        description: The API Key for authentication to the MaaS server. Can use MAAS_APIKEY environment variable instead.
        required: false
        type: str

Examples:

# Get information based on the hostname
- name: Get information about machine based on hostname
  tomkivlin.maas.get_system_id:
    hostname: server1
    maas_url: http://maas_server:5240/MAAS/
    maas_apikey: fsdfsdfsdf:sdfsdfsdf:sdfsdfsdf

# Get information based on the system_id
- name: Get information based on the system_id
  tomkivlin.maas.get_system_id:
    power_address: 10.1.1.100
    maas_url: http://maas_server:5240/MAAS/
    maas_apikey: fsdfsdfsdf:sdfsdfsdf:sdfsdfsdf

ansible-collection-maas's People

Contributors

tomkivlin 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.