Skip to content

Ansible playbook to setup a full development environment in a container.

License

Notifications You must be signed in to change notification settings

johrstrom/dev-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup a development environment in a container

This project uses ansible to build containers and images - through buildah - that are ultimately a development environment.

This was started because on the Fedora Silverblue OS one is supposed to use containers for everything and install very little on the actual OS.

So, borrowing a lot from Tomas Tomecek's excellent blog I set out to build my own development environment in a highly reproduce-able way.

From the top level directory run this command

ansible-playbook main.yml --extra-vars=@config.yml

to build the image.

Things to reconfigure

Be sure to take a look at config.yml and reconfigure to what you want. There are a lot of configurations that are specific to me like image_name because that defaults to jeffo-dev-env which is perhaps not the image name that you want.

Roles

I could never get handler sharing across plays to work right, so I had to divide everything out into roles even though there's not much to any of them.

container -- this role configures the container

container-ctrl -- this role actually pulls and tags images. The other roles rely on it's handlers.

image -- this role installs rpms and makes users and does all the OS level stuff on the container

When the playbook fails

If the playbook fails, the next run of the playbook will correctly handle the error of using a container that's already in use.

or the hard way directly removing the containers. buildah rm tmp/dev-wrk if you've replace the variable working_container then the command will be

build rm <container_name> replacing container_name here with what you've provided.

About

Ansible playbook to setup a full development environment in a container.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages