Skip to content

Commit

Permalink
add infra-server org and user config to automate recipe (#6)
Browse files Browse the repository at this point in the history
* add infra-server org and user config to automate recipe
  • Loading branch information
Stromweld authored Mar 20, 2023
1 parent 516ee31 commit aa388b1
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 36 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,37 @@ on:

jobs:
markdownlint:
uses: Stromweld/github-workflows/.github/workflows/markdownlint.yml@main
uses: Stromweld/github-workflows/.github/workflows/markdown-lint.yml@main

yamllint:
uses: Stromweld/github-workflows/.github/workflows/yamllint.yml@main
uses: Stromweld/github-workflows/.github/workflows/yaml-lint.yml@main

jsonlint:
uses: Stromweld/github-workflows/.github/workflows/jsonlint.yml@main
uses: Stromweld/github-workflows/.github/workflows/json-lint.yml@main

cookstylelint:
uses: Stromweld/github-workflows/.github/workflows/cookstylelint.yml@main
uses: Stromweld/github-workflows/.github/workflows/cookstyle-lint.yml@main

integration-dokken:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- amazonlinux-2
# - amazonlinux-2022
- amazonlinux-2023
- centos-7
- centos-8
- centos-stream-8
- centos-stream-9
- almalinux-8
# - almalinux-9 # TODO: uncomment this when almalinux-9 dokken image is fixed
- almalinux-9
- rockylinux-8
- rockylinux-9
- ubuntu-2004
- ubuntu-2204
suite:
- default
- automate
- supermarket
exclude:
- os: centos-7
suite: default
- os: ubuntu-2204
suite: default
- os: ubuntu-2204
suite: supermarket
fail-fast: false
steps:
- name: Check out code
Expand All @@ -54,7 +50,6 @@ jobs:
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
continue-on-error: false
- name: Test-Kitchen Verify
uses: actionshub/test-kitchen@main
with:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This file is used to list changes made in each version of the chef_software cookbook.

## 2.1.0 (20232-03-17)

- [Corey Hemminger] - Add Integrated Infra-Server user and org config to automate recipe

## 2.0.2 (2022-09-29)

- [Corey Hemminger] - Removed chef-ingredient reference to fork from policyfile
Expand Down
26 changes: 23 additions & 3 deletions kitchen.dokken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,34 @@ platforms:
image: dokken/amazonlinux-2
pid_one_command: /usr/lib/systemd/systemd

- name: amazonlinux-2023
driver:
image: dokken/amazonlinux-2023
pid_one_command: /usr/lib/systemd/systemd

- name: centos-7
driver:
image: dokken/centos-7
pid_one_command: /usr/lib/systemd/systemd

- name: centos-8
- name: centos-stream-8
driver:
image: dokken/centos-8
image: dokken/centos-stream-8
pid_one_command: /usr/lib/systemd/systemd

- name: centos-stream-9
driver:
image: dokken/centos-stream-9
pid_one_command: /usr/lib/systemd/systemd

- name: rockylinux-8
driver:
image: dokken/rockylinux-8
pid_one_command: /usr/lib/systemd/systemd

- name: rockylinux-9
driver:
image: dokken/rockylinux-9
pid_one_command: /usr/lib/systemd/systemd

- name: debian-10
Expand All @@ -48,7 +68,7 @@ platforms:

- name: debian-11
driver:
image: dokken/debian-10
image: dokken/debian-11
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
Expand Down
14 changes: 0 additions & 14 deletions kitchen.exec.yml

This file was deleted.

9 changes: 6 additions & 3 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ platforms:
- name: almalinux-8
- name: almalinux-9
- name: amazonlinux-2
# - name: amazonlinux-2022
- name: rockylinux-8
- name: rockylinux-9
# - name: amazonlinux-2023
- name: centos-7
- name: centos-8
- name: centos-stream-8
- name: centos-stream-9
- name: debian-10
- name: debian-11
- name: ubuntu-20.04
Expand All @@ -43,7 +46,7 @@ suites:
named_run_list: 'chef_automatev2'
driver:
customize:
memory: 2193
memory: 3072
verifier:
inspec_tests:
- test/integration/default
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
maintainer_email '[email protected]'
license 'Apache-2.0'
description 'Installs/Configures chef server, chef automate2, chef supermarket'
version '2.0.2'
version '2.1.0'
chef_version '>= 16.4'

issues_url 'https://github.com/Stromweld/chef_software/issues'
Expand Down
18 changes: 18 additions & 0 deletions recipes/chef_automatev2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@
create_iam_policy(hash['policy_json'])
end
end

if node['chef_software']['chef_automatev2']['products'].include?('infra-server')
node['chef_software']['chef_user']&.each do |name, hash|
chef_user name do
hash&.each do |key, value|
send(key, value)
end
end
end

node['chef_software']['chef_org']&.each do |name, hash|
chef_org name do
hash&.each do |key, value|
send(key, value)
end
end
end
end

0 comments on commit aa388b1

Please sign in to comment.