Giter Club home page Giter Club logo

specinfra's Introduction

libspecnfra

What is this

Libspecinfra is a project to make the alternative of specinfra gem by Rust.

Specinfra gem is a base library of serverspec .

Specinfra gem is made of Ruby, so you cannot call the functions of specinfra from other languages.

Libspecinfra project will provide binary library and language bindings to call this library. So you will be able to call the functions of specinfra from many languages.

This project is in the phase of very beginning. If you have comments, questions and so on, feel free to post comments in GitHub Issues.

Here is the Japanese post about this project.

Language bindings

We provide only Ruby and mruby bindings currently.

Other languages will be supported.

Sample code

This is a sample mruby code to get the permission of /etc/passwd of local host:

b = Libspecinfra::Backend::Direct.new()
s = Libspecinfra::Specinfra.new(b)
f = s.file("/etc/passwd")

printf("%#o", f.mode)

This is a sample mruby code to get the permission of /etc/passwd via SSH:

b = Libspecinfra::Backend::SSH.new("localhost")
s = Libspecinfra::Specinfra.new(b)
f = s.file("/etc/passwd")

printf("%#o", f.mode)

Other language examples are here .

Internal components(for developers)

Libspecinfra consists of some internal components. These components are:

  • Platforms
    • Platforms detects OS/distributions and returns suitable providers.
  • Backends
    • Currently two backends are supported.
    • Direct Backend: Run functions of libspecinfra on the target host directly.
    • SSH Backend: Run functions of libspecinfra on the target host via SSH.
  • Resources
    • Resources are abstraction layers of several resources.
    • File, package, servcice, user, group and so on.
    • Only file resource is supported currently.
  • Providers
    • Concrete implementations of resources.
    • Provider has two types: Inline providers and shell providers.
    • Inline providers are used with direct backend. It handles resources by rust code.
    • Inline providers also have concrete implementations. For example, posix provider of file resource for UNIX-like OS.
    • Shell providers are used with SSH backend and so on. It handles resources by shell command.
    • Shell providers also have concrete implementatiosn. For example, bsd provider of file resource for OS based on BSD.
    • If inline providers for some resources do not exist, direct backend uses shell providers instead of inline providers.

Support matrix

These are support matrix of platforms, backends, resources and providers.

Resources and inline providers

This matrix shows which resources support which type of inline providers.

Resources Inline Providers
File ✔️ Posix
Service ✔️ Systemd

Platforms and shell providers

Platforms File Service Package Port
macOS ✔️
Ubuntu ✔️ ✔️ (trusty and xenial) ✔️ (apt) ✔️ (netstat)
AIX ✖️
Alpine Linux ✖️
Amazon Linux ✖️
Arch Linux ✖️
CoreOS ✖️
Cumulus Linux ✖️
Debian Linux ✖️
elementary OS ✖️
EOS(Arista) ✖️
VMWare ESXi ✖️
Fedora ✖️
FreeBSD ✖️
Gentoo Linux ✖️
Linux MInt ✖️
NixOS ✖️
OpenBSD ✖️
openSUSE ✖️
Plamo Linux ✖️
Poky(Yokto) ✖️
Red Hat Linux ✔️ ✔️ (6 and 7) ✔️ (yum) ✔️ (netstat)
SUSE Linux Enterprise Server ✖️
SmartOS ✖️
Solaris ✖️
SuSE Linux ✖️
Windows ✖️

TODO

Resources

This is a list of resources which should be implemented. These resources are picked up from Resource Types of Serverspec . So some resources are implemented in serverspec, not in specinfra.

  • bond
  • bridge
  • cgroup
  • command
  • cron
  • default gateway
  • docker container
  • docker image
  • file
  • group
  • host
  • iis app pool
  • iis website
  • interface
  • ip6tables
  • ipfilter
  • ipnat
  • iptables
  • kernel module
  • linux audit system
  • linux kernel parameter
  • lxc
  • mail alias
  • mysql config
  • package
  • php config
  • port
  • ppa
  • process
  • routing table
  • selinux
  • selinux module
  • service
  • user
  • x509_certificate
  • x509_private_key
  • windows_feature

Platforms

This is a list of platforms should be implemented. Specinfra gem supports these platforms.

  • AIX
  • Alpine Linux
  • Amazon Linux
  • Arch Linux
  • CoreOS
  • Cumulus Linux
  • MacOS(Darwin)
  • Debian Linux
  • elementary OS
  • EOS(Arista)
  • VMWare ESXi
  • Fedora
  • FreeBSD
  • Gentoo Linux
  • Linux MInt
  • NixOS
  • OpenBSD
  • openSUSE
  • Plamo Linux
  • Poky(Yokto)
  • Redhat Linux
  • SUSE Linux Enterprise Server
  • SmartOS
  • Solaris
  • SuSE Linux
  • Ubuntu
  • Windows

Backends

This is a list of backends which should be implemented. Specinfra gem supports these backends.

  • CMD(Windows)
  • Docker
  • Exec
  • jexex
  • LXC
  • SSH
  • Telnet
  • WinRM

specinfra's People

Contributors

mizzy avatar marcy-terui avatar pocket7878 avatar

Stargazers

Daniel Vinciguerra avatar  avatar  avatar Takumi Takahashi avatar ut-ymmt avatar Jutaro avatar Jürgen Hermann avatar Omer Katz avatar Joseph Kordish avatar Takuma Kume avatar hitsumabushi avatar SUGIYAMA Yoshio avatar YAMAMOTO Yuji avatar yaegassy avatar Wataru Matsui avatar cybai (Haku) avatar Takahiro Horike avatar Kevin Ramsunder avatar  avatar i2tsuki avatar itchyny avatar saturday06 avatar Shingo YOSHIDA 吉田真吾 avatar Shimpei Makimoto avatar Takaaki Furukawa avatar Tomohisa Oda avatar  avatar Kenji Naito avatar Talos avatar  avatar Takuma Ishikawa avatar volanja avatar Shuya Motouchi avatar Ryota Yoshikawa avatar BABA Toshiaki avatar Dann avatar Hideo Hattori avatar yukihir0 avatar Rust avatar eigo_s avatar Tatsushi Demachi avatar yT avatar Okada Haruki avatar Yohei Kawahara avatar lhside avatar tjinjin avatar Keiichiro Ui avatar Shinichi Kogai avatar Tomoya Kabe avatar  avatar Kei IWASAKI avatar Tomohiro Taira avatar Kent Gruber avatar Keiji Matsuzaki avatar KITAITI Makoto avatar Ken’ichiro Oyama avatar Yuuki TSUBOUCHI avatar Koji Ota avatar akira-kuriyama avatar Seiei Miyagi avatar Masashi Fujita avatar Mitsutaka Mimura avatar Okumura Takahiro avatar karupanerura avatar Hiroki Zenigami avatar smly avatar

Watchers

 avatar hirose31 avatar Takeshi Watanabe avatar  avatar Takaaki Furukawa avatar KITAITI Makoto avatar James Cloos avatar Kenji Naito avatar Okumura Takahiro avatar Magnolia.K avatar

specinfra's Issues

Inappropriate error

HandleFuncNotDefinedError seems to be returned when execute file.linked_to() on the file which is not link.

Investigate and fix it.

How to handle file resource when the file does not exist

Currently, file.is_symlink() for the file which does not exist returns IO error "No such file directory".

Which is prefer, we should return error like current behavior, or should not return error and should return boolean(false) result ?

Using SSH backend without ssh-agent

Hi,

I want to run libspecinfra on CI services (e.g. Circle CI) and FaaS (e.g. AWS Lambda).
These services may be difficult to use ssh-agent.

So, I would like to implement the another way to use SSH backend that specify the host, user and key file or password.

@mizzy What do you think about these options?

First,

  1. Change SSH backend to be able to use without ssh-sgent
  2. Add a new backend
  3. Any ideas?

Next, (Only if we choice 1 at first)

  1. Change the argument of the backend_ssh_new cffi interface to a structure. This is very simple. But it has a breaking change.
  2. Add a new cffi interface.
  3. Any ideas?

Testing

We need unit tests and integration tests.

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.