diff --git a/.github/stale.yml b/.github/stale.yml index e69de29..f4a1eba 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -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. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fb1c7f..3e1116c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/kitchen.yml b/kitchen.yml index 03ddd9a..f444d63 100755 --- a/kitchen.yml +++ b/kitchen.yml @@ -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: diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 5f1f777..69b9a54 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -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 diff --git a/recipes/chef_automatev2.rb b/recipes/chef_automatev2.rb index 75223f7..1a07219 100644 --- a/recipes/chef_automatev2.rb +++ b/recipes/chef_automatev2.rb @@ -22,10 +22,12 @@ 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 @@ -33,7 +35,7 @@ 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