Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Stromweld committed Mar 3, 2024
1 parent e2a9515 commit 1452119
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
19 changes: 19 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- WIP
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: This issue has been closed due to no activity please reopen if you believe this is still an issue.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ jobs:
- server
- automate
- supermarket
exclude:
- os: almalinux-9
suite: supermarket
- os: rockylinux-8
suite: server
- os: rockylinux-8
suite: supermarket
- os: rockylinux-9
suite: supermarket
- os: ubuntu-2204
suite: supermarket
fail-fast: false
steps:
- name: Check out code
Expand Down
8 changes: 4 additions & 4 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ suites:
named_run_list: 'chef_server'
driver:
customize:
memory: 3328
memory: 4096
verifier:
inspec_tests:
- test/integration/default
- test/integration/chef_server
attributes:
chef_software:
automate_admin_token: mIUYdbBD6U8a9wg3IAbXScEjiXs=
- name: automate
named_run_list: 'chef_automatev2'
driver:
customize:
memory: 3072
memory: 4096
verifier:
inspec_tests:
- test/integration/default
- test/integration/chef_automate
attributes:
chef_software:
automate_admin_token: lazy { shell_out('chef-automate iam token create admin --admin').stdout.strip }
- name: supermarket
named_run_list: 'chef_supermarket'
verifier:
Expand Down
4 changes: 4 additions & 0 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def get_iam_user(user)
def get_iam_policy(policy_name)
Mash.new(JSON.parse(shell_out("curl --insecure -s -H \"api-token: #{node['chef_software']['automate_admin_token']}\" https://localhost/apis/iam/v2/policies/#{policy_name}").stdout))
end

def kitchen_api_token
shell_out('chef-automate iam token create admin --admin').stdout.strip
end
end
end

Expand Down
6 changes: 4 additions & 2 deletions recipes/chef_automatev2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@
end
end

test = lazy { shell_out('chef-automate iam token create admin --admin').stdout.strip }

node['chef_software']['automatev2_local_users']&.each do |name, hash|
iam_user name do
user_hash hash['user_json']
api_token lazy { node['chef_software']['automate_admin_token'] }
api_token kitchen? ? test : node['chef_software']['automate_admin_token']
action :create
end
end

node['chef_software']['automatev2_iam_policies']&.each do |name, hash|
iam_policy name do
policy_hash hash['policy_json']
api_token lazy { node['chef_software']['automate_admin_token'] }
api_token kitchen? ? test : node['chef_software']['automate_admin_token']
action :create
end
end
Expand Down

0 comments on commit 1452119

Please sign in to comment.