Giter VIP home page Giter VIP logo

nut-formula's Introduction

nut-formula

Travis CI Build Status Semantic Release

A SaltStack formula to install and configure Network UPS Tools.

See the full SaltStack Formulas installation and usage instructions.

If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.

If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning.

See Formula Versioning Section for more details.

If you need (non-default) configuration, please pay attention to the pillar.example file and/or Special notes section.

Commit message formatting is significant!!

Please see How to contribute for more details.

NUT has server and client applications and packages are usually separated in those two categories, so the states reflect this situation:

  • <server> states are required to manage the packages that directly deal with the UPS (driver, nut-server, etc.)
  • <client> states are required to manage the packages that communicate with the nut-server (upsmon, upssched, etc.)

Following NUT's configuration logic, when nut.mode: 'none', the .running states will do nothing and skip the services management. Therefore, they'll be left as the OS packages set them.

For each of the components, there are meta-states named after the component that will include other states in the component subdir that perform the actual work.

For example, using server will include, in order:

  • server.package.install
  • server.config.mode
  • server.config.ups
  • server.config.upsd
  • server.config.users
  • server.service.running

You can use individual states, like

  • client.package.install
  • client.config.upsmon

Meta-state (This is a state that includes other states).

This installs the nut server and client packages, manages the nut configuration files and then starts the associated nut services.

This state will install the nut <component> packages only.

This state will configure the nut <component> service/s and has a dependency on nut.<component>.package.install via include list.

This state will start the nut <component> service/s and has a dependency on nut.<component>.config via include list.

Meta-state (This is a state that includes other states).

this state will undo everything performed in the nut meta-state in reverse order, i.e. stops the service, removes the configuration file and then uninstalls the packages.

This state will stop the nut <component> service/s and disables them at boot time.

This state will remove the configuration of the nut <component> service and has a dependency on nut.<component>.service.clean via include list.

This state will remove the nut <component> package/s and has a depency on nut.<component>.config.clean via include list.

Meta-state (This is a state that includes other states).

This state installs, configures and manage a <component> and starts the associated services.

Linux testing is done with kitchen-salt.

Requirements

  • Ruby
  • Docker
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.yml, e.g. debian-9-2019-2-py3.

bin/kitchen converge

Creates the docker instance and runs the nut main state, ready for testing.

bin/kitchen verify

Runs the inspec tests on the actual instance.

bin/kitchen destroy

Removes the docker instance.

bin/kitchen test

Runs all of the stages above in one go: i.e. destroy + converge + verify + destroy.

bin/kitchen login

Gives you SSH access to the instance for manual testing.

nut-formula's People

Contributors

aboe76 avatar baby-gnu avatar dafyddj avatar javierbertoli avatar kartnico avatar myii avatar noelmcloughlin avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nut-formula's Issues

Jinja variable 'salt.utils.odict.OrderedDict object' has no attribute 'maxretry'

Hi,

When I try to use nut-formula, I have this error :

      ID: ups_conf
Function: file.managed
    Name: /etc/ups/ups.conf
  Result: False
 Comment: Unable to manage file: Jinja variable 'salt.utils.odict.OrderedDict object' has no attribute 'maxretry'
 Started: 12:00:41.313716
Duration: 118.689 ms
 Changes:   

My salt-minion version :

salt-call --versions-report
Salt Version:
       Salt: 2019.2.0

Dependency Versions:
       cffi: Not Installed
   cherrypy: Not Installed
   dateutil: Not Installed
  docker-py: Not Installed
      gitdb: Not Installed
  gitpython: Not Installed
      ioflo: Not Installed
     Jinja2: 2.7.2
    libgit2: Not Installed
    libnacl: Not Installed
   M2Crypto: Not Installed
       Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
 mysql-python: Not Installed
  pycparser: Not Installed
   pycrypto: 2.6.1
 pycryptodome: Not Installed
     pygit2: Not Installed
     Python: 2.7.5 (default, Apr  9 2019, 14:30:50)
 python-gnupg: Not Installed
     PyYAML: 3.10
      PyZMQ: 15.3.0
       RAET: Not Installed
      smmap: Not Installed
    timelib: Not Installed
    Tornado: 4.2.1
        ZMQ: 4.1.4

System Versions:
       dist: centos 7.6.1810 Core
     locale: UTF-8
    machine: x86_64
    release: 3.10.0-957.12.2.el7.x86_64
     system: Linux
    version: CentOS Linux 7.6.1810 Core

I have the error only for "ups_conf" state. All other states are "ok".

I tried also with "pillars" to change "maxretry" parameter, but I always have the error.
I also have the error for every parameters in "ups_config" dict.

Regards,

Nicolas

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.