Skip to content

ported compliance generator functionality into chef-load#37

Merged
rickmarry merged 6 commits intomasterfrom
rm/compliance-generator
Aug 15, 2018
Merged

ported compliance generator functionality into chef-load#37
rickmarry merged 6 commits intomasterfrom
rm/compliance-generator

Conversation

@rickmarry
Copy link
Copy Markdown
Contributor

Ported the Compliance Generator into chef-load.
This works exactly as it did in our original implementation which was written in ruby.
This piece supports generating data back a configurable amount of days.
A new configuration section has been added to the chef-load.toml which is needed in order for this functionality to work properly.

@@ -435,14 +466,16 @@ func randomChefClientRun(config *Config, chefClient chef.Client, nodeName string
}

// TODO: (@afiune) Notify Data Collector of compliance report
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR doesn't cover this section of the code? Are we going to use it at all? if not, can we remove it?

Copy link
Copy Markdown
Contributor Author

@rickmarry rickmarry Aug 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not take it out for now because what i'd really like to do with this generator is to harmonize it better with the rest of the way the generation stuff works with chef_runs. When we do complete that, then this commented out section of code will be useful once again. This pr just adds in generator, exactly as it works in our current ruby version, just so that we could stop using the ruby version of generator and get all things generation into chef_load (where they all belong).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌮

platform string
}

func GenerateComplianceData(config *Config, requests chan *request) error {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we prevent compliance data to be generated? Meaning that if I only wanna generate a number of nodes, or just a number of actions, how can I disable compliance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the toml, just set matrix.simulation.nodes = 0

# Matrix settings for Compliance Generation
[matrix]

[matrix.samples]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a very complete matrix, not a sample one. Could we make it a bit shorter? otherwise the config generator will create a very long "sample" config that might be overwhelming.

An idea could be to generate another file with this data called /path/to/compliance-matrix.toml and then in the sample config add a line like you did with compliance_sample_reports_dir , for example:

# Explain explain explain what is this file for, muchas gracias!
# compliance_matrix = "/path/to/compliance-matrix.toml"

// TODO catch error
GenerateChefActions(config, requests)
GenerateCCRs(config, requests)
var wg sync.WaitGroup
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMAZING!! Thank you @rickmarry !!! 🎉

Copy link
Copy Markdown

@afiune afiune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really like us to separate the matrix from the config file. It is getting a bit to big, out of that I really like this change!!! Thank you so much Rick for all your awesome work, I can't wait for the harmonization between Chef Data and Compliance Data.

tenor-87266010

@rickmarry rickmarry merged commit 4113ae6 into master Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants