Build base command
This commit is contained in:
parent
6ccef74622
commit
87ddb81336
@ -0,0 +1,8 @@
|
|||||||
|
# set dotenv-load := true
|
||||||
|
set shell := ["bash","-eu","-o","pipefail","-c"]
|
||||||
|
|
||||||
|
setup:
|
||||||
|
rye sync
|
||||||
|
|
||||||
|
run:
|
||||||
|
rye run ansible localhost -m ansible.builtin.setup
|
||||||
1
.python-version
Normal file
1
.python-version
Normal file
@ -0,0 +1 @@
|
|||||||
|
3.12.9
|
||||||
33
README.md
33
README.md
@ -0,0 +1,33 @@
|
|||||||
|
# Inspector
|
||||||
|
|
||||||
|
Simple utility that will inspect your local system and report on that.
|
||||||
|
|
||||||
|
This is expected to be run from a debian 13 live cd and requirements are tailored to that. This
|
||||||
|
is an extension to existing information with standard tools and immediatley gain insights from the
|
||||||
|
resources on the current machine.
|
||||||
|
|
||||||
|
Data sources:
|
||||||
|
|
||||||
|
* [Ansible]()
|
||||||
|
* `lshw`
|
||||||
|
* /proc
|
||||||
|
|
||||||
|
## Installation process
|
||||||
|
|
||||||
|
Calling `install` will bootstrap the environment in an idempotent way. But will enable the local
|
||||||
|
workflow and python environment for the inpector to work in.
|
||||||
|
|
||||||
|
This will bootstrap the installation of `Justfile`, `git`, `rye`, and use `rye sync` for managing
|
||||||
|
the workspace dependencies while providing a very simple entry point across the various commands.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
$ ./install.sh
|
||||||
|
|
||||||
|
Prepares environment for use.
|
||||||
|
|
||||||
|
$ just scan
|
||||||
|
|
||||||
|
New inspection result <sysid>-<timestamp>. The report is the raw text of the process.
|
||||||
|
|
||||||
|
$ just summarize
|
||||||
3
inspector
Executable file → Normal file
3
inspector
Executable file → Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("CLI call")
|
||||||
34
install.sh
34
install.sh
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# system dependencies
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y git
|
||||||
|
|
||||||
|
# Install just if not found
|
||||||
|
if ! command -v just &> /dev/null
|
||||||
|
then
|
||||||
|
echo "just not found, installing..."
|
||||||
|
sudo apt install -y just
|
||||||
|
else
|
||||||
|
echo "just is already installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install rye if not found
|
||||||
|
if ! command -v rye &> /dev/null
|
||||||
|
then
|
||||||
|
echo "rye not found, installing..."
|
||||||
|
# The official rye installation script
|
||||||
|
curl -sSf https://rye-up.com/get | bash
|
||||||
|
# Source rye's env to make it available in the current shell for this script
|
||||||
|
source "$HOME/.rye/env"
|
||||||
|
else
|
||||||
|
echo "rye is already installed."
|
||||||
|
# Ensure rye's env is sourced if it's already installed but not in PATH
|
||||||
|
if ! command -v rye &> /dev/null
|
||||||
|
then
|
||||||
|
source "$HOME/.rye/env"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# rye setup will manage python version and dependencies
|
||||||
|
rye sync
|
||||||
26
pyproject.toml
Normal file
26
pyproject.toml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
[project]
|
||||||
|
name = "inspector"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "System inspection routine."
|
||||||
|
authors = [
|
||||||
|
{ name = "Sean Wilbur", email = "sean@abutili.com" }
|
||||||
|
]
|
||||||
|
dependencies = [
|
||||||
|
"ansible>2.19",
|
||||||
|
]
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">= 3.12"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["hatchling"]
|
||||||
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
|
[tool.rye]
|
||||||
|
managed = true
|
||||||
|
dev-dependencies = []
|
||||||
|
|
||||||
|
[tool.hatch.metadata]
|
||||||
|
allow-direct-references = true
|
||||||
|
|
||||||
|
[tool.hatch.build.targets.wheel]
|
||||||
|
packages = ["src/inspector"]
|
||||||
32
requirements-dev.lock
Normal file
32
requirements-dev.lock
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# generated by rye
|
||||||
|
# use `rye lock` or `rye sync` to update this lockfile
|
||||||
|
#
|
||||||
|
# last locked with the following flags:
|
||||||
|
# pre: false
|
||||||
|
# features: []
|
||||||
|
# all-features: false
|
||||||
|
# with-sources: false
|
||||||
|
# generate-hashes: false
|
||||||
|
# universal: false
|
||||||
|
|
||||||
|
-e file:.
|
||||||
|
ansible==12.0.0
|
||||||
|
# via inspector
|
||||||
|
ansible-core==2.19.2
|
||||||
|
# via ansible
|
||||||
|
cffi==2.0.0
|
||||||
|
# via cryptography
|
||||||
|
cryptography==45.0.7
|
||||||
|
# via ansible-core
|
||||||
|
jinja2==3.1.6
|
||||||
|
# via ansible-core
|
||||||
|
markupsafe==3.0.2
|
||||||
|
# via jinja2
|
||||||
|
packaging==25.0
|
||||||
|
# via ansible-core
|
||||||
|
pycparser==2.23
|
||||||
|
# via cffi
|
||||||
|
pyyaml==6.0.2
|
||||||
|
# via ansible-core
|
||||||
|
resolvelib==1.2.0
|
||||||
|
# via ansible-core
|
||||||
32
requirements.lock
Normal file
32
requirements.lock
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# generated by rye
|
||||||
|
# use `rye lock` or `rye sync` to update this lockfile
|
||||||
|
#
|
||||||
|
# last locked with the following flags:
|
||||||
|
# pre: false
|
||||||
|
# features: []
|
||||||
|
# all-features: false
|
||||||
|
# with-sources: false
|
||||||
|
# generate-hashes: false
|
||||||
|
# universal: false
|
||||||
|
|
||||||
|
-e file:.
|
||||||
|
ansible==12.0.0
|
||||||
|
# via inspector
|
||||||
|
ansible-core==2.19.2
|
||||||
|
# via ansible
|
||||||
|
cffi==2.0.0
|
||||||
|
# via cryptography
|
||||||
|
cryptography==45.0.7
|
||||||
|
# via ansible-core
|
||||||
|
jinja2==3.1.6
|
||||||
|
# via ansible-core
|
||||||
|
markupsafe==3.0.2
|
||||||
|
# via jinja2
|
||||||
|
packaging==25.0
|
||||||
|
# via ansible-core
|
||||||
|
pycparser==2.23
|
||||||
|
# via cffi
|
||||||
|
pyyaml==6.0.2
|
||||||
|
# via ansible-core
|
||||||
|
resolvelib==1.2.0
|
||||||
|
# via ansible-core
|
||||||
Loading…
Reference in New Issue
Block a user