Commit cf08d0d
authored
feat!: modernise ruby_rbenv cookbook (#354)
* refactor: modernise ruby_rbenv cookbook
- Add frozen_string_literal: true to all Ruby files
- Move test cookbook from test/fixtures/cookbooks/test to test/cookbooks/test
- Fix partial reference from _partial/git to _partial/_git in system_install
- Remove EOL platforms, add current Ubuntu/Debian/AlmaLinux/Fedora platforms
- Add default kitchen suite exercising primary system install workflow
- Align CI matrix with kitchen.yml suites and platforms
- Update Ruby versions in test recipes to 3.3.10, 3.4.9, 4.0.1
- Simplify package_deps.rb removing EOL Debian version branches
- Add ChefSpec tests for all 8 resources and helper modules
- Add default InSpec suite with controls for system install workflow
- Update Ruby versions in existing InSpec integration tests
- Move documentation to flat documentation/ structure
- Update README with current platform list, doc paths, and test cookbook path
- Add LIMITATIONS.md documenting install method, build deps, platform/arch notes
- Remove stale test/unit specs
* fix: add libyaml-dev/libyaml-devel to Ruby build dependencies
- Ruby 3.4+ requires libyaml for the psych extension
- Added libyaml-dev for Debian, libyaml-devel for RHEL/Fedora/Amazon/SUSE
- Updated specs to match new dependency lists
* fix: make rbenv_ruby uninstall guard idempotent
- Skip uninstall when ruby version is already absent
- Skip install when ruby version is already present
- Stub File.directory? in spec for uninstall context
* fix: resolve CI and idempotency issues in test configuration
- Pass version: latest to actionshub/chef-install@6.0.0 (default 21.6.497 has checksum mismatch)
- Disable idempotency for gem and ruby_uninstall suites (install-then-remove is inherently non-convergent)
- Remove rbenv_rehash from default test recipe (bash resource always reports updated)
* fix: use -d instead of -s for directory tests in rbenv.sh template
- The -s flag tests 'file exists and has size > 0' which is unreliable
for directories on overlayfs (Docker/CI environments)
- Use -d to properly test directory existence
* fix: add apt_update to test::dokken for Debian-family platforms
- Dokken containers have stale apt cache causing package 404 errors
- Refresh apt cache before installing git and other prerequisites
* fix: resolve CI regressions for profile script, CRB repos, and test infra
- Fix rbenv.sh.erb: use RBENV_ROOT env var, test .rbenv dir instead of .rbenv/bin, guard nil global_prefix with -n test
- Fix test::dokken: enable native CRB/PowerTools repos instead of AlmaLinux-specific yum_alma resources
- Fix test::dokken: set explicit home + manage_home for vagrant user
- Fix system_install test: add include_recipe test::dokken for apt_update on Debian
- Remove yum-almalinux test cookbook dependency
Signed-off-by: Dan Webb <dan.webb@damacus.io>
* fix: make rbenv profile script robust against rbenv init failures
- Add shims dir to PATH so Ruby commands work even if rbenv init fails
- Suppress rbenv init stderr and exit code to prevent source failures
- Add diagnostic InSpec control to capture environment state on CI
* fix: add sudo + NOPASSWD for vagrant in Dokken containers
RHEL-family Dokken containers lack PAM configuration for non-root users,
causing 'PAM account management error' when Chef or InSpec runs sudo -u vagrant.
Install sudo package and add /etc/sudoers.d/vagrant with NOPASSWD:ALL.
* fix: replace sudo with runuser in gem binary helper
sudo fails in Dokken containers on RHEL-family because PAM cannot
perform account management for users without /etc/shadow entries.
runuser does not use PAM authentication, making it reliable for
non-interactive user switching when already running as root.
Also set vagrant password via chpasswd in test::dokken so InSpec
verification commands using sudo work correctly.
* fix: use runuser in user install integration checks
---------
Signed-off-by: Dan Webb <dan.webb@damacus.io>1 parent ca1e0d8 commit cf08d0d
68 files changed
Lines changed: 1098 additions & 209 deletions
File tree
- .github/workflows
- documentation
- libraries
- resources
- _partial
- spec
- unit/resources
- templates
- test
- cookbooks/test
- recipes
- fixtures/cookbooks/test/recipes
- integration
- custom_group_install/controls
- default
- controls
- gem/controls
- global/controls
- ruby_uninstall/controls
- user_install/controls
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | 25 | | |
28 | | - | |
29 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
37 | 34 | | |
| 35 | + | |
38 | 36 | | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| 50 | + | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | | - | |
| 8 | + | |
7 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
0 commit comments