GithubHelp home page GithubHelp logo

kmpm / ansible-collection-incus Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 112 KB

Collection of Ansible plugins for dealing with Incus from Linuxcontainers

License: GNU General Public License v3.0

Python 100.00%

ansible-collection-incus's Introduction

Ansible Collection - kmpm.incus

This repository contains the kmpm.incus collection. The goal for this collection is to eventually be incorporated into Ansibles community.general collection.

The module connection module for incus is already included in the community.general connection and is not included here.

Disclaimer

It is very much a Work In Progress and contains bugs, missing features etc. It might destroy everything on your machine (unlikely) and delete everyting in incus (somewhat likely). It will eventually be strict about semver versioning but for not every change could be a breaking one.

Tested with Ansible

This collection is currently only tested with core-2.16 and python 3.11. It might be extended to support older versions but currently there are only some python >3.7 code used.

External requirements

All modules depend on a locally installed and configured incusCLI. That same incus CLI must have PR lxc/incus#581 included. This probably means incus > 0.6.0.

Using this collection

The collection is not yet published in Ansible Galaxy but can be installed with `ansible-galaxy collection install git+https://github.com/kmpm/ansible-collection-incus.git

Modules

- hosts: localhost
  connection: local
  - tasks:
    - name: create a network
      incus_network:
        name: make_me_some_network
        type: bridge
        config:
            ipv4.address: "192.168.42.0/24"
            ipv4.dhcp: "false"
            ipv6.address: "none"

    - name: get some info about networks
      incus_network_info:
        name: mynetwork # optional name if you want just one network
        project: default # optional 
        # target: sometarget # defaults to empty
      register: netinfo

    - name: create a instance
      incus_instance:
        name: mycontainer
        source: # No default for source. You will need what you need.
            type: image
            alias: debian/12/cloud
            server: "https://images.linuxcontainers.org"
            protocol: simplestreams
            mode: pull
            allow_inconsistent: false

    - name: delete instance
      incus_instance:
        name: mycontainer
        state: absent

    - name: delete network
      incus_network:
        name: mynetwork
        state: absent

Inventory

There is a incus inventory module but no docs yet.

License

GPL-3.0-or-later

ansible-collection-incus's People

Contributors

fbouliane avatar kmpm avatar krouma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-collection-incus's Issues

ansible_connection=incus connection plugin not found

I use in my hosts file:

[all:vars]
ansible_connection=lxd

I replaced it with:

[all:vars]
ansible_connection=incus

But when I run my playbook, i get " FAILED! => {"msg": "the connection plugin 'incus' was not found"}"

Everything else so far works fine (after patching the collection until the PR that is open is merged)

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.