Skip to content

Commit

Permalink
fix lazy usage (#49)
Browse files Browse the repository at this point in the history
* fix lazy usage

the lazy {} block should be passed to variables() property, not per
attribute in the dict.
  • Loading branch information
mattp- authored Oct 31, 2024
1 parent e0846ba commit 4910db0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 33 deletions.
41 changes: 12 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,17 @@ name: ci
- main

jobs:
delivery:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run Chef Delivery
uses: actionshub/chef-delivery@main
env:
CHEF_LICENSE: accept-no-persist

yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run yaml Lint
uses: actionshub/yamllint@main

mdl:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run Markdown Lint
uses: actionshub/markdownlint@main
lint-unit:
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@3.1.1
permissions:
actions: write
checks: write
pull-requests: write
statuses: write
issues: write

integration:
needs: [delivery]
needs: lint-unit
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -56,11 +39,11 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Chef
uses: actionshub/chef-install@3.0.0
uses: actionshub/chef-install@main
- name: Dokken
uses: actionshub/test-kitchen@3.0.0
uses: actionshub/test-kitchen@main
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
Expand Down
10 changes: 6 additions & 4 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
owner 'root'
group 'root'
mode '0644'
variables(
settings: lazy { node['nscd'] },
databases: lazy { sanitize_databases(node['nscd']['databases']) }
)
variables(lazy do
{
settings: node['nscd'],
databases: sanitize_databases(node['nscd']['databases']),
}
end)
cookbook node['nscd']['template_cookbook']
notifies :restart, 'service[nscd]'
end
Expand Down

0 comments on commit 4910db0

Please sign in to comment.