I am trying to setup my development environment (on my local Linux pc) via some automatic mechanism. I tried ansible playbooks, they work quite well.
Let's assume a playbook like this ("SetupDevEnv.yml")
---
- hosts: localhost
tasks:
- name: install packages
apt:
state: present
name:
- gcc
- clang
- vscode
- ...
After running :
$ ansible-playbook SetupDevEnv.yml
My local pc is ready to go with all the toolchain tools needed (gcc, clang, vscode, ...).
Is it possible to do the same thing with packer? If yes, how would it look like? Would it also be possible to use the existing Ansible playbooks?
Remark1: The important point here is I want to do it for my local pc (localhost) only. I do not want to generate a VM or a Docker container to which I have to log in afterward. The idea is: the "SetupDevEnv.yml" (or the packer file) is located in the repository. The developer checks out the repository runs the setup generation and starts to work.
Remark2: To clarify the question, my question is: "How would the packer HCL/json file look like to do the same as in "SetupDevEnv.yml"? Or how would the packer HCL/json file look like which uses the "SetupDevEnv.yml"? If this is possible.