1

I've been trying to stick to the "infrastructure as code" principle as much as possible in my work.

But after the devops project got more complicated I started loosing the centralized perspective because the scope of used technologies and complexity are very rich: terraform, terraformer, terragrunt, pscore, bash, Azure CLI, Azure DevOps CLI, AzureAD module, msbuild, Java, various REST API calls...

So I started writting scripts and code that calculate "desired vs current" state just for validation and overview, if everything is in the right state. Most of the time this information is everything I need, I don't need to "go to the desired state" because sometimes that actually means manual intervention (sometimes even from someone else).

The output of these scripts is simple, currently they write into stdout something like this:

Name of thing         Desired state      Current state     Result
----------------------------------------------------------------------
THING A               This               That              NOT GOOD
THING B               This               This              GOOD
THING C               This               ?                 Timeout after 5 minutes
...

Result: 
- 2 things needs attention

My question is if there is some tool or standard targeted at this specific use case?

  • I have scripts, I could call them "diff calculators" that can output whether some "thing" or "subthing of thing" is in desired state and what is the current state
  • The tool produces nice table based UI output
1
  • I wrote EXACTLY this tool, with EXACTLY the same columns, LOL, to check which microservices I need to deploy for a release.It's Gradle and ECS specific. I use ECS to get what versions are currently deployed (via AWS CLI commands), and use Gradle dependencies task to get what my desired versions are. – Chris F Mar 19 at 19:33
0

I found Pester which is just a powershell unit testing that can save Nunit XML results which can be published inside the pipeline.

It's not "desired"/"current" state I had hoped for but it can in the end provide a nice overview of all the "things" whose states I need to observe.

0

This seems like the sort of thing that configuration management tools like ansible are intended to solve. You can run ansible in check mode to see what it would do.

3
  • Wow, I thought ansible was dead. It should be. – Software Engineer Mar 20 at 9:24
  • Ansible is one of the nicer configuration management systems available. If puppet and chef are still kicking then ansible should be doing quite nicely for itself. – chicks Mar 20 at 13:37
  • I've not seen a single good argument for ansible since its inception. I believe it's broken by design, is solving the wrong problem, and is even doing that the wrong way. – Software Engineer Mar 20 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.