moose-inventory 1.0.9 → 2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +15 -1
- data/.github/workflows/release.yml +60 -0
- data/.gitignore +2 -1
- data/.gitleaks.toml +9 -0
- data/.rubocop.yml +49 -0
- data/BACKLOG.md +752 -24
- data/Gemfile +2 -0
- data/Gemfile.lock +36 -1
- data/README.md +340 -44
- data/Rakefile +2 -0
- data/bin/moose-inventory +2 -1
- data/docs/architecture/architecture-and-trust-boundaries.md +444 -0
- data/docs/compatibility/cli-output-compatibility.md +76 -0
- data/docs/governance/approval-register.md +37 -0
- data/docs/maintenance/database-backup-restore-guidance.md +162 -0
- data/docs/maintenance/package-maintenance-and-agent-boundaries.md +260 -0
- data/docs/process/conformance-gap-analysis-2026-05-28.md +192 -0
- data/docs/product/product-brief.md +161 -0
- data/docs/product/requirements-baseline.md +477 -0
- data/docs/qa/qa-documentation-and-release-gates.md +283 -0
- data/docs/release/package-provenance-hardening.md +126 -0
- data/docs/release/publishing.md +54 -50
- data/docs/release/release-environment-protection.md +70 -0
- data/docs/release/release-readiness.md +37 -4
- data/docs/security/accepted-risk-register.md +84 -0
- data/docs/security/security-privacy-process.md +287 -0
- data/docs/security-audit-2026-05-26-rerun.md +75 -0
- data/docs/security-audit-2026-05-26.md +63 -0
- data/docs/ux/cli-workflow-notes.md +287 -0
- data/examples/ansible/ansible.cfg +3 -0
- data/examples/ansible/inventory/moose_inventory.yml +5 -0
- data/examples/ansible/inventory_plugins/moose_inventory.py +100 -0
- data/examples/ci/README.md +16 -0
- data/examples/ci/github-actions/inventory-review.yml +38 -0
- data/examples/ci/inventory/example-snapshot.yml +19 -0
- data/examples/ci/scripts/validate-inventory-snapshot.sh +30 -0
- data/lib/moose_inventory/cli/application.rb +133 -5
- data/lib/moose_inventory/cli/association_rendering.rb +74 -0
- data/lib/moose_inventory/cli/association_rendering_support.rb +89 -0
- data/lib/moose_inventory/cli/audit.rb +62 -0
- data/lib/moose_inventory/cli/audit_recording.rb +40 -0
- data/lib/moose_inventory/cli/child_relation_rendering.rb +110 -0
- data/lib/moose_inventory/cli/console.rb +135 -0
- data/lib/moose_inventory/cli/db.rb +64 -0
- data/lib/moose_inventory/cli/factory.rb +28 -0
- data/lib/moose_inventory/cli/formatter.rb +8 -12
- data/lib/moose_inventory/cli/group.rb +7 -1
- data/lib/moose_inventory/cli/group_add.rb +91 -73
- data/lib/moose_inventory/cli/group_addchild.rb +41 -66
- data/lib/moose_inventory/cli/group_addhost.rb +33 -71
- data/lib/moose_inventory/cli/group_addvar.rb +27 -47
- data/lib/moose_inventory/cli/group_get.rb +8 -42
- data/lib/moose_inventory/cli/group_list.rb +7 -40
- data/lib/moose_inventory/cli/group_listvars.rb +9 -55
- data/lib/moose_inventory/cli/group_rm.rb +105 -73
- data/lib/moose_inventory/cli/group_rmchild.rb +47 -57
- data/lib/moose_inventory/cli/group_rmhost.rb +34 -61
- data/lib/moose_inventory/cli/group_rmvar.rb +30 -41
- data/lib/moose_inventory/cli/group_tags.rb +33 -0
- data/lib/moose_inventory/cli/helpers.rb +143 -0
- data/lib/moose_inventory/cli/host.rb +8 -2
- data/lib/moose_inventory/cli/host_add.rb +91 -66
- data/lib/moose_inventory/cli/host_addgroup.rb +39 -66
- data/lib/moose_inventory/cli/host_addvar.rb +28 -52
- data/lib/moose_inventory/cli/host_get.rb +9 -37
- data/lib/moose_inventory/cli/host_list.rb +24 -21
- data/lib/moose_inventory/cli/host_listvars.rb +9 -62
- data/lib/moose_inventory/cli/host_rm.rb +60 -42
- data/lib/moose_inventory/cli/host_rmgroup.rb +39 -55
- data/lib/moose_inventory/cli/host_rmvar.rb +31 -45
- data/lib/moose_inventory/cli/host_tags.rb +33 -0
- data/lib/moose_inventory/cli/listvars_support.rb +55 -0
- data/lib/moose_inventory/cli/plan_rendering.rb +50 -0
- data/lib/moose_inventory/cli/relation_transaction_support.rb +51 -0
- data/lib/moose_inventory/cli/tag_support.rb +97 -0
- data/lib/moose_inventory/cli/variable_rendering.rb +67 -0
- data/lib/moose_inventory/config/config.rb +185 -108
- data/lib/moose_inventory/db/db.rb +188 -193
- data/lib/moose_inventory/db/exceptions.rb +6 -3
- data/lib/moose_inventory/db/models.rb +16 -0
- data/lib/moose_inventory/db/schema_migrations.rb +248 -0
- data/lib/moose_inventory/inventory_context.rb +116 -0
- data/lib/moose_inventory/operations/add_associations.rb +131 -0
- data/lib/moose_inventory/operations/add_groups.rb +123 -0
- data/lib/moose_inventory/operations/add_hosts.rb +123 -0
- data/lib/moose_inventory/operations/add_variables.rb +77 -0
- data/lib/moose_inventory/operations/entity_variable_operation_support.rb +46 -0
- data/lib/moose_inventory/operations/group_child_relations.rb +125 -0
- data/lib/moose_inventory/operations/group_cleanup.rb +70 -0
- data/lib/moose_inventory/operations/import_inventory_snapshot.rb +41 -0
- data/lib/moose_inventory/operations/inventory_doctor.rb +172 -0
- data/lib/moose_inventory/operations/inventory_snapshot.rb +60 -0
- data/lib/moose_inventory/operations/inventory_snapshot_applier.rb +112 -0
- data/lib/moose_inventory/operations/inventory_snapshot_preview.rb +174 -0
- data/lib/moose_inventory/operations/inventory_snapshot_validator.rb +134 -0
- data/lib/moose_inventory/operations/operation_event_support.rb +27 -0
- data/lib/moose_inventory/operations/query_inventory/base_query.rb +24 -0
- data/lib/moose_inventory/operations/query_inventory/group_queries.rb +86 -0
- data/lib/moose_inventory/operations/query_inventory/host_queries.rb +106 -0
- data/lib/moose_inventory/operations/query_inventory.rb +47 -0
- data/lib/moose_inventory/operations/remove_associations.rb +113 -0
- data/lib/moose_inventory/operations/remove_groups.rb +79 -0
- data/lib/moose_inventory/operations/remove_hosts.rb +68 -0
- data/lib/moose_inventory/operations/remove_variables.rb +67 -0
- data/lib/moose_inventory/runtime_options.rb +31 -0
- data/lib/moose_inventory/version.rb +3 -1
- data/lib/moose_inventory.rb +10 -7
- data/moose-inventory.gemspec +22 -35
- data/scripts/check.sh +3 -0
- data/scripts/ci/check_generated_artifacts.sh +41 -0
- data/scripts/ci/check_permissions.sh +5 -0
- data/scripts/ci/check_rubocop.sh +33 -0
- data/scripts/ci/check_secrets.sh +26 -0
- data/scripts/ci/check_security.sh +18 -0
- data/scripts/ci/install_security_tools.sh +47 -0
- data/scripts/files.rb +5 -4
- data/scripts/install_dependencies.sh +2 -0
- data/spec/examples/ci_examples_spec.rb +37 -0
- data/spec/lib/moose_inventory/ansible_plugin_examples_spec.rb +29 -0
- data/spec/lib/moose_inventory/cli/application_doctor_spec.rb +50 -0
- data/spec/lib/moose_inventory/cli/application_import_export_spec.rb +100 -0
- data/spec/lib/moose_inventory/cli/application_spec.rb +25 -15
- data/spec/lib/moose_inventory/cli/audit_spec.rb +56 -0
- data/spec/lib/moose_inventory/cli/cli_spec.rb +15 -19
- data/spec/lib/moose_inventory/cli/console_spec.rb +98 -0
- data/spec/lib/moose_inventory/cli/factory_spec.rb +27 -0
- data/spec/lib/moose_inventory/cli/formatter_spec.rb +95 -3
- data/spec/lib/moose_inventory/cli/group_add_spec.rb +140 -116
- data/spec/lib/moose_inventory/cli/group_addchild_spec.rb +89 -35
- data/spec/lib/moose_inventory/cli/group_addhost_spec.rb +81 -84
- data/spec/lib/moose_inventory/cli/group_addvar_spec.rb +65 -68
- data/spec/lib/moose_inventory/cli/group_get_spec.rb +17 -33
- data/spec/lib/moose_inventory/cli/group_list_spec.rb +16 -38
- data/spec/lib/moose_inventory/cli/group_listvar_spec.rb +33 -40
- data/spec/lib/moose_inventory/cli/group_rm_spec.rb +165 -85
- data/spec/lib/moose_inventory/cli/group_rmchild_spec.rb +100 -30
- data/spec/lib/moose_inventory/cli/group_rmhost_spec.rb +76 -78
- data/spec/lib/moose_inventory/cli/group_rmvar_spec.rb +57 -63
- data/spec/lib/moose_inventory/cli/group_spec.rb +2 -0
- data/spec/lib/moose_inventory/cli/helpers_spec.rb +146 -0
- data/spec/lib/moose_inventory/cli/host_add_spec.rb +170 -116
- data/spec/lib/moose_inventory/cli/host_addgroup_spec.rb +100 -83
- data/spec/lib/moose_inventory/cli/host_addvar_spec.rb +92 -74
- data/spec/lib/moose_inventory/cli/host_get_spec.rb +14 -33
- data/spec/lib/moose_inventory/cli/host_list_spec.rb +41 -33
- data/spec/lib/moose_inventory/cli/host_listvar_spec.rb +45 -53
- data/spec/lib/moose_inventory/cli/host_rm_spec.rb +66 -48
- data/spec/lib/moose_inventory/cli/host_rmgroup_spec.rb +73 -83
- data/spec/lib/moose_inventory/cli/host_rmvar_spec.rb +56 -63
- data/spec/lib/moose_inventory/cli/host_spec.rb +2 -0
- data/spec/lib/moose_inventory/cli/tags_spec.rb +81 -0
- data/spec/lib/moose_inventory/config/config_spec.rb +41 -3
- data/spec/lib/moose_inventory/db/db_spec.rb +551 -29
- data/spec/lib/moose_inventory/db/exceptions_spec.rb +18 -0
- data/spec/lib/moose_inventory/db/models_spec.rb +7 -3
- data/spec/lib/moose_inventory/db_lifecycle_spec.rb +73 -0
- data/spec/lib/moose_inventory/inventory_context_spec.rb +10 -0
- data/spec/lib/moose_inventory/operations/add_associations_spec.rb +111 -0
- data/spec/lib/moose_inventory/operations/add_groups_spec.rb +80 -0
- data/spec/lib/moose_inventory/operations/add_hosts_spec.rb +82 -0
- data/spec/lib/moose_inventory/operations/add_variables_spec.rb +103 -0
- data/spec/lib/moose_inventory/operations/group_child_relations_spec.rb +122 -0
- data/spec/lib/moose_inventory/operations/import_inventory_snapshot_spec.rb +226 -0
- data/spec/lib/moose_inventory/operations/inventory_doctor_spec.rb +77 -0
- data/spec/lib/moose_inventory/operations/inventory_snapshot_spec.rb +50 -0
- data/spec/lib/moose_inventory/operations/operation_event_support_spec.rb +78 -0
- data/spec/lib/moose_inventory/operations/query_inventory_spec.rb +146 -0
- data/spec/lib/moose_inventory/operations/remove_associations_spec.rb +113 -0
- data/spec/lib/moose_inventory/operations/remove_groups_spec.rb +78 -0
- data/spec/lib/moose_inventory/operations/remove_hosts_spec.rb +55 -0
- data/spec/lib/moose_inventory/operations/remove_variables_spec.rb +83 -0
- data/spec/shared/shared_config_setup.rb +4 -3
- data/spec/spec_helper.rb +50 -40
- data/spec/support/cli_harness.rb +33 -0
- metadata +163 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 439e23e1ec3d1ed0e83f686ddd062c07215f8575febd515dc65657f3bdc70c45
|
|
4
|
+
data.tar.gz: d07bd1e237be3056bf54f338eccc240b74790378d94d1c40d6bc86f2b3b226f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72d9b7d85c843ad90d5b9d41aea47390c5ec6ea9bca1844bf2e7912e9bdeca39214718652e8f3ef44bda1deb83ff54ab0667e5652b81e516f332263ccf5fd83d
|
|
7
|
+
data.tar.gz: ddad54b04a60635044cf8d312283bd59fd6c42d8862c5759166ee219a275d2b38469fd358ca839ef1c519903736f932e315fa9f1ad6a8b31e8bfa4e0575f75f6
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: CI
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
workflow_dispatch:
|
|
4
5
|
push:
|
|
5
6
|
branches: [master]
|
|
6
7
|
pull_request:
|
|
@@ -9,6 +10,7 @@ on:
|
|
|
9
10
|
permissions:
|
|
10
11
|
contents: read
|
|
11
12
|
|
|
13
|
+
|
|
12
14
|
jobs:
|
|
13
15
|
test:
|
|
14
16
|
runs-on: ubuntu-latest
|
|
@@ -18,7 +20,7 @@ jobs:
|
|
|
18
20
|
ruby-version: ['3.2', '3.3', '3.4']
|
|
19
21
|
steps:
|
|
20
22
|
- name: Check out repository
|
|
21
|
-
uses: actions/checkout@
|
|
23
|
+
uses: actions/checkout@v5
|
|
22
24
|
|
|
23
25
|
- name: Set up Ruby
|
|
24
26
|
uses: ruby/setup-ruby@v1
|
|
@@ -26,10 +28,22 @@ jobs:
|
|
|
26
28
|
ruby-version: ${{ matrix.ruby-version }}
|
|
27
29
|
bundler-cache: true
|
|
28
30
|
|
|
31
|
+
- name: Set up Go for security tools
|
|
32
|
+
uses: actions/setup-go@v6
|
|
33
|
+
with:
|
|
34
|
+
go-version: '1.25.x'
|
|
35
|
+
cache: false
|
|
36
|
+
|
|
29
37
|
- name: Install native build dependencies
|
|
38
|
+
timeout-minutes: 5
|
|
30
39
|
run: |
|
|
31
40
|
sudo apt-get update
|
|
32
41
|
sudo apt-get install -y build-essential default-libmysqlclient-dev libpq-dev libsqlite3-dev
|
|
33
42
|
|
|
43
|
+
- name: Install security audit tools
|
|
44
|
+
run: ./scripts/ci/install_security_tools.sh
|
|
45
|
+
|
|
34
46
|
- name: Run local check gate
|
|
47
|
+
env:
|
|
48
|
+
MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS: '1'
|
|
35
49
|
run: ./scripts/check.sh
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Release gem
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
push:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
environment: release
|
|
16
|
+
steps:
|
|
17
|
+
- name: Check out repository
|
|
18
|
+
uses: actions/checkout@v5
|
|
19
|
+
with:
|
|
20
|
+
persist-credentials: false
|
|
21
|
+
|
|
22
|
+
- name: Set up Ruby
|
|
23
|
+
uses: ruby/setup-ruby@v1
|
|
24
|
+
with:
|
|
25
|
+
ruby-version: '3.4'
|
|
26
|
+
bundler-cache: true
|
|
27
|
+
|
|
28
|
+
- name: Set up Go for security tools
|
|
29
|
+
uses: actions/setup-go@v6
|
|
30
|
+
with:
|
|
31
|
+
go-version: '1.25.x'
|
|
32
|
+
cache: false
|
|
33
|
+
|
|
34
|
+
- name: Install native build dependencies
|
|
35
|
+
timeout-minutes: 5
|
|
36
|
+
run: |
|
|
37
|
+
sudo apt-get update
|
|
38
|
+
sudo apt-get install -y build-essential default-libmysqlclient-dev libpq-dev libsqlite3-dev
|
|
39
|
+
|
|
40
|
+
- name: Install security audit tools
|
|
41
|
+
run: ./scripts/ci/install_security_tools.sh
|
|
42
|
+
|
|
43
|
+
- name: Verify tag matches gem version
|
|
44
|
+
run: |
|
|
45
|
+
version="$(ruby -e "require './lib/moose_inventory/version'; puts Moose::Inventory::VERSION")"
|
|
46
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
47
|
+
if [ "$tag" != "$version" ]; then
|
|
48
|
+
echo "Tag v$tag does not match gem version $version" >&2
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
- name: Run local check gate
|
|
53
|
+
env:
|
|
54
|
+
MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS: '1'
|
|
55
|
+
run: ./scripts/check.sh
|
|
56
|
+
|
|
57
|
+
- name: Publish gem to RubyGems
|
|
58
|
+
uses: rubygems/release-gem@v1
|
|
59
|
+
with:
|
|
60
|
+
await-release: false
|
data/.gitignore
CHANGED
data/.gitleaks.toml
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
NewCops: enable
|
|
3
|
+
SuggestExtensions: false
|
|
4
|
+
TargetRubyVersion: 3.2
|
|
5
|
+
|
|
6
|
+
Metrics/AbcSize:
|
|
7
|
+
Max: 32
|
|
8
|
+
|
|
9
|
+
Metrics/MethodLength:
|
|
10
|
+
Max: 25
|
|
11
|
+
|
|
12
|
+
Metrics/ModuleLength:
|
|
13
|
+
Exclude:
|
|
14
|
+
- lib/moose_inventory/config/config.rb
|
|
15
|
+
- lib/moose_inventory/db/db.rb
|
|
16
|
+
|
|
17
|
+
Metrics/CyclomaticComplexity:
|
|
18
|
+
Max: 7
|
|
19
|
+
|
|
20
|
+
Metrics/PerceivedComplexity:
|
|
21
|
+
Max: 8
|
|
22
|
+
|
|
23
|
+
Metrics/BlockLength:
|
|
24
|
+
Exclude:
|
|
25
|
+
- spec/lib/moose_inventory/cli/formatter_spec.rb
|
|
26
|
+
- spec/lib/moose_inventory/cli/host_rm_spec.rb
|
|
27
|
+
- spec/lib/moose_inventory/config/config_spec.rb
|
|
28
|
+
- spec/lib/moose_inventory/db/db_spec.rb
|
|
29
|
+
- spec/lib/moose_inventory/operations/add_hosts_spec.rb
|
|
30
|
+
- spec/lib/moose_inventory/operations/add_groups_spec.rb
|
|
31
|
+
- spec/lib/moose_inventory/operations/add_associations_spec.rb
|
|
32
|
+
- spec/lib/moose_inventory/operations/remove_associations_spec.rb
|
|
33
|
+
- spec/lib/moose_inventory/operations/group_child_relations_spec.rb
|
|
34
|
+
- spec/lib/moose_inventory/operations/remove_groups_spec.rb
|
|
35
|
+
- spec/lib/moose_inventory/operations/add_variables_spec.rb
|
|
36
|
+
- spec/lib/moose_inventory/operations/remove_hosts_spec.rb
|
|
37
|
+
- spec/lib/moose_inventory/operations/remove_variables_spec.rb
|
|
38
|
+
- spec/lib/moose_inventory/operations/query_inventory_spec.rb
|
|
39
|
+
|
|
40
|
+
Style/Documentation:
|
|
41
|
+
Enabled: false
|
|
42
|
+
|
|
43
|
+
Style/FormatStringToken:
|
|
44
|
+
Exclude:
|
|
45
|
+
- lib/moose_inventory/config/config.rb
|
|
46
|
+
|
|
47
|
+
Lint/RescueException:
|
|
48
|
+
Exclude:
|
|
49
|
+
- lib/moose_inventory/db/db.rb
|