GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - boostyc/nut-formula: A Saltstack formula to install and configure NUT (Network UPS Tools)

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

121 Commits
121 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
docs
docs
 
 
nut
nut
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.rstcheck.cfg
.rstcheck.cfg
 
 
.rubocop.yml
.rubocop.yml
 
 
.salt-lint
.salt-lint
 
 
.travis.yml
.travis.yml
 
 
.yamllint
.yamllint
 
 
AUTHORS.md
AUTHORS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODEOWNERS
CODEOWNERS
 
 
FORMULA
FORMULA
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
LICENSE
LICENSE
 
 
commitlint.config.js
commitlint.config.js
 
 
kitchen.yml
kitchen.yml
 
 
pillar.example
pillar.example
 
 
pre-commit_semantic-release.sh
pre-commit_semantic-release.sh
 
 
release-rules.js
release-rules.js
 
 
release.config.js
release.config.js
 
 

Repository files navigation

nut-formula

Travis CI Build Status Semantic Release

A SaltStack formula to install and configure Network UPS Tools.

Table of Contents

  • General notes
  • Contributing to this repo
  • Usage
  • Special notes
  • Available states
  • Testing

General notes

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.

Contributing to this repo

Commit message formatting is significant!!

Please see How to contribute for more details.

Usage

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

Special notes

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.

Available states

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
  • nut
  • nut.<component>.package
  • nut.<component>.config
  • nut.<component>.service
  • nut.clean
  • nut.<component>.service.clean
  • nut.<component>.config.clean
  • nut.<component>.package.clean
  • nut.<component>

nut

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.

nut.<component>.package

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

nut.<component>.config

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

nut.<component>.service

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

nut.clean

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.

nut.<component>.service.clean

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

nut.<component>.config.clean

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

nut.<component>.package.clean

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

nut.<component>

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

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

Testing

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.

About

A Saltstack formula to install and configure NUT (Network UPS Tools)

docs.saltstack.com/en/latest/topics/development/conventions/formulas.html

Resources

Readme
License
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.