This project provides a Nix expression to build Bash script to connect to servers with IPMI support.
Before you begin, ensure you have met the following requirements:
- You have installed either Nix, NixOS, Docker
- You received IPMI credentials
To install IPMI Sciprt, follow these steps:
Build the container with Nix:
nix-build --no-out-link
Then import the container and look launch command:
sudo docker load /nix/store/….tar.gz
sudo docker inspect docker-registry.intr/utils/nix-ipmi:master | grep cmd
make sure xhost
is installed on your system and run the container, e.g.:
xhost +local:
docker run --rm --network=host --tty --interactive --user 1000:997 \
--env DISPLAY=$DISPLAY --volume /etc/localtime:/etc/localtime:ro \
--volume /tmp/.X11-unix:/tmp/.X11-unix docker-registry.intr/utils/nix-ipmi:master \
jenkins.ipmi IPMI_PASSWORD
NOTE: Replace IPMI_PASSWORD
.
Add an overlay as you prefer, for example:
with import <nixpkgs> {
overlays = [
(self: super: {
ipmi = (super.callPackage (builtins.fetchGit {
url = "https://gitlab.intr/utils/nix-ipmi";
ref = "master";
}) { });
# …
})
];
};
Add a ipmi
package to your package collection:
You could create a new package, which wraps ipmi
package with
default environment variables, for example:
(stdenv.mkDerivation {
name = "ipmi";
builder = writeScript "builder.sh" (''
source $stdenv/setup
mkdir -p $out/bin
cat > $out/bin/ipmi <<'EOF'
#!${bash}/bin/bash
IPMI_HOST=$1 IPMI_OUTPUT=/tmp/$IPMI_HOST.jviewer.jnlp \
IPMI_USER=ADMIN IPMI_PASSWORD=$(cat $HOME/.ipmi_password) \
${ipmi}/bin/ipmi
EOF
chmod 555 $out/bin/ipmi
'');
})
$HOME/.ipmi_password
is a plain text file, but you could use GPG or
password manager like password-store.
Prefetch jdk-7u75-linux-x64.tar.gz in your Nix Store.
nix-shell --pure --run 'ipmi web16.ipmi.intr IPMI_PASSWORD' --show-trace
web16.ipmi.intr web25.intr.ipmi web15.ipmi.intr web24.ipmi.intr
To use Nix IPMI just call ipmi with a server name, for example:
ipmi jenkins.ipmi
If you have the following error, launch "ControlPanel" from a terminal, then in "Security" tab set "Security Level" to "Medium".
Your security settings have blocked a self-signed application from running
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
Make sure ipmi
could connect to web16.ipmi.intr web25.intr.ipmi
web15.ipmi.intr web24.ipmi.intr.
Thanks to the following people who have contributed to this project:
If you want to contact me you can reach me at go.wigust@gmail.com.
This project uses the following license: GPL3+.