Ansible Execution Environments
Вставка
- Опубліковано 11 вер 2024
- This video will cover how what are execution environments, why they exist, how they make ansible development easier, the pieces involved in building them, and how I leverage Ansible to streamline the entire build process for me.
The presenter is Alex Dworjan
GitHub:
github.com/sha...
Blogs:
www.ansible.co...
www.ansible.co...
Thanks for the video!!
Very helpful, thank you
I love you for this
Thanks for the demo!! How do we pass multiple environment variables to the execution environment before the playbook is executed on the target m/c??
www.techbeatly.com/how-to-pass-environment-variables-to-ansible-navigator/
This is the easiest way to describe it if you are using ansible-navigator. If you are using automation controller, you can set environment variables as credentials which would then be passed into the EE if you assign it as a credential for the Job Template.
One aspect I do not see is the process of installing an RPM file into the environment. Do you have any info on that?
That's what I show at 9:58 in the bindep.txt. This is where you define any system dependencies which are RPM for RHEL based systems.
Thanks, I missed it. @@alexdworjan
thank you sir for such information , but please where we can get those files? because i could not find that main.yml file in the repo , thank you
There are 3 different examples in the Ansible-PAH repo, build_creationee, build_shadowmandevspaces, build_shadowmanee
thank you@@alexdworjan
how do u use a base image present in the vm? i dont want to access the internet for it.
With Ansible Builder Version 3, you can use any base image ua-cam.com/video/YTtBW2rDNE4/v-deo.html
Thanks for the demo. Can we add the collection to the existing Execution Environment?
I would recommend re-building the execution environment if the collection you are using has any dependencies associated with it. If you just want to add collections at runtime in automation controller, you can add a collections/requirements.yml to your repository with the additional collections you want to add
@@alexdworjan Appreciate your answer. I have the requirements.yml in my ansible role directory. But the collections are not found as my execution environment doesn't include those collections.
@@chinvannak1076 This only applies if I'm using Automation Controller / Ansible Tower during a project sync. And it also is specifically looking for the folder "collections/requirements.yml" to input existing collections at runtime. It can't be in a role directory, it must be from the project root.
@@alexdworjan Thanks, that was helpful. Just another small issue, I got a certificate that failed while trying to install collections from the private hub. Appreciate your advice.
@@chinvannak1076 If that's while you are installing collections in Controller during a project sync, my guess is that you are using self-signed certificates. If that's the case, you'll need to go into Settings, Jobs, and toggle the switch for "Ignore Ansible Galaxy SSL Certificate Verification" Otherwise you'll want to have your corporate certs on both Controller and Private Automation Hub
Why not dockers and/or virtual machine images....,
and does it integrate with online dependencies ?
and how does it integrate with universal security and depug (?eclipse)....
can it boot from bare metal, hybrid cloud, k-clouds, ceph stores....
The execution environment can use podman or docker as the container engine, but it isn't designed to be a stand-alone system that you are running or booting. The purpose of an execution environment is to be a portable way to easily run Ansible playbooks without needing to install system packages and python libraries on the VM itself. All of the necessary dependencies are contained in the EE so it makes standing up a new Ansible server extremely fast. It can integrate with some IDE like VS Code for easier editing.
@@alexdworjanWe can install vscode inside the EE? How can i edit file with vscode inside the container? Or you said completly another thing...?
@@12dodo37 No, VSCode with the Ansible extension can leverage the EE that you create. This means VSCode would be using Ansible+Ansible-Lint+all of the collections I have installed. So VSCode would be installed on your laptop (or use Code Server). I walk through all the different options in this playlist: ua-cam.com/video/C8908KSjn78/v-deo.html&pp=gAQBiAQB
@@alexdworjan Thank you for the rapid response! Im going to check that now!
Very helpful, thank you