Infrastructure simplifying engineer
Date: 2025-02-12
I’ve made some practical experiments with GPT in the IaC context and gave a speech about that at the meetup.
I’m using chatGPT like solutions in real life for different purpose:
And I realized 🔥 it works well. But what’s about the IaC? is it usefull?
There are many solutions available publicly:
However, I’ve decided to limit myself to Copilot because it integrates smoothly with VSCode and is allowed for use. The main limitation is that only public data is allowed.
Goal: Fluent, easy-to-read texts without mistakes.
Pros:
Cons:
Conclusion: 🔥 it works well.
Goal: Transform the script get-latest-version.py
to an Ansible lookup plugin. The purpose of the script was to:
Pros:
Cons:
Conclusion: ✅ ok to use for well known domain area.
Goal: Avoid boring tasks.
Pros:
Cons:
Conclusion: ✅ it works well.
Goal: Understand written templates.
Pros:
Cons:
Conclusion: ✅ ok to use for well known domain area.
Goal: Get list of VMs from OTC in Ansible friendly format.
Pros:
Cons:
Conclusion: ⛔️ fail.
Goal: Fix errors during Java installation.
Pros:
Cons:
Conclusion: ❓ acceptable.
Goal: Understand infrastructure dependencies across the different parts.
Pros:
Cons:
Conclusion: ⛔️ doesn’t work.
Pros | Cons |
---|---|
Improves readability | Lacks context |
Proposes syntax changes | Possible errors in suggestions |
Generates documentation | Requires iterations |
Step-by-step explanations | Limited knowledge |
Generates configurations | Unable to identify root causes |
Conclusion: ❗️just imagine that there is very smart junior in your team.
In case of IaC I’m following IDLC(SDLC for IaC) approach and I think it can be improved.
Make GPT as an optional reviewer in a repo:
Conclusion: ❗️ IDLC can be improved.
There is IaC testing pyramid concept. It describes how to test IaC. The problem is that it’s slow or just linting. The idea is that maybe it will be possible to add gpt to Static Analysis level. I.e. simulate an ansible or terraform execution without real execution. Maybe it will be faster or cheaper.
Conclusion: ❗️ IaC testing can be improved.