SlideShare a Scribd company logo
1 of 19
Download to read offline
Collections in Ansible Core
Gonéri Le Bouder
Senior Software Engineer, Ansible Core
COLLECTIONS
● A new means to distribute Ansible content currently in TECH
PREVIOUS
○ An artifact format for consistent content structure
○ Contains 1-N of roles, modules, plugins and module utilities
○ Enables versioning of external content
○ Enables consistent delivery independent of Ansible distributions
○ Installable as system, user or project resources
● Immediate use of the content found within the artifact
● Namespacing support built into the collection
● Difficult distribution of non-role content
● Plugin/role name collisions
● Difficult code-sharing for most plugins
What problems do collections solve?
● Multiple roles with deps? Good luck.
● Roles already distribute plugins- done?
○ Requires role to be "entered" (see also ansible-wtf)
○ Plugins are not "first-class citizens"
○ Versioning/maintenance issues
Problem 1: Content Distribution
● Collection may contain 1-N:
○ Roles/Modules/Plugins
○ Playbooks (future/TBD)
● Collection is the unit of distribution and versioning
● Installable:
○ globally
○ per-user
○ content-adjacent (ie per-project)
Content Distribution with Collections
● Default paths (searched in this order, configurable)
○ (current playbook)/collections
○ ~/.ansible/collections
○ /usr/share/ansible/collections
● Mazer/ansible-galaxy
Installing collections content
● Ansible has a global(ish) flat plugin namespace
● Role1 and Role2 both distribute my_module
○ Which one will get used? (ha!)
○ Can I use them both in the same run? (no)
○ What if core later includes a my_module? (screwed)
○ What if the project has in library/ ?
○ What if the user has in ~/.ansible/?
○ What if the system has in /usr/share/ansible ?
○ Issue exists for roles and all modules/plugins
Problem 2: Name Collisions
● Collections have a namespace and name
○ For distribution, namespace == Galaxy user/org
● Content in collections is accessed by namespace
○ mynamespace.mycollection.my_module
○ f5.bigip.provisioning_role
● Built-in collections
○ ansible.builtin
○ ansible.legacy
Namespacing with Collections
- hosts: somehosts
tasks:
- myns.mycollection.athing:
- ansible.builtin.ping: # use only the ping packaged in core
- ansible.legacy.ping: # use core or library(etc)/ping.py
when: thing | myns.mycollection.filter == 42
- ping: # still works, == ansible.legacy.ping:
Sample playbook
That's awfully verbose...
- hosts: somehosts
collections:
- ansible.builtin
- myns.mycollection
- otherns.othercollection
tasks:
- mymodule: # first found in the list of collections
- otherns.othercollection.mymodule: # fully-qualified is fine
Enter the collections keyword
● module_utils only works for modules
○ unless you're "in the box"
○ perverse incentives
● eg, Azure/AWS want to share utility code between
○ modules/actions/inventory/lookup plugins
● Just use pip!
Problem 3: Code sharing
● Entire collection is a Python namespace package
● All installed collection content is accessible
○ even across collections!
○ ansible_collections root Python namespace
○ ansible_collections.mynamespace.mycollection
● PEP302 loader magic
○ collection is the smallest unit of distributed namespace
Code sharing in Collections
Demo
● VirtLightning: a solution to deploy VM
● Python code base, no Ansible module (yet!)
● Does not fit in the $role/library model
○ The module should be usable everywhere
○ The Inventory plugin won’t work
● Not ready for a core inclusion
○ Not mature yet
● Good candidate for a collection!
Demo
Recording
https://asciinema.org/a/241619
Repository
https://github.com/virt-lightning/ansible-collection-virt-lightning
Demo
● Experimental in 2.8
● https://github.com/ansible/ansible/pull/52194
● Basics are working (see PR for docs/known issues)
● Playbooks-in-collections not implemented in 2.8
● Galaxy/Mazer/Tower support?
● Molecule, etc?
Collections-in-core project status
● IRC #ansible and #ansible-devel
● Mailing list: Ansible-Project
● https://www.ansible.com/community
Feedback wanted
Questions?

More Related Content

Similar to Montreal ansible meetup april 17th, 2019

Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageAndrii Lundiak
 
WPSessions Composer for WordPress Plugin Development
WPSessions Composer for WordPress Plugin DevelopmentWPSessions Composer for WordPress Plugin Development
WPSessions Composer for WordPress Plugin DevelopmentCaldera Labs
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Eugenio Minardi
 
Eclipse Training - Introduction
Eclipse Training - IntroductionEclipse Training - Introduction
Eclipse Training - IntroductionLuca D'Onofrio
 
Improve Your IBM Domino Designer Experience
Improve Your IBM Domino Designer ExperienceImprove Your IBM Domino Designer Experience
Improve Your IBM Domino Designer Experiencepanagenda
 
Effectively using Open Source with conda
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with condaTravis Oliphant
 
Deep dive - Concourse CI/CD and Pipelines
Deep dive  - Concourse CI/CD and PipelinesDeep dive  - Concourse CI/CD and Pipelines
Deep dive - Concourse CI/CD and PipelinesSyed Imam
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kiteChristian Opitz
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxRohitKumar639388
 
HKG18-419 - OpenHPC on Ansible
HKG18-419 - OpenHPC on AnsibleHKG18-419 - OpenHPC on Ansible
HKG18-419 - OpenHPC on AnsibleLinaro
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with AnsibleIvan Serdyuk
 
Intellij IDEA Intro, Tips and Tricks
Intellij IDEA Intro, Tips and TricksIntellij IDEA Intro, Tips and Tricks
Intellij IDEA Intro, Tips and Tricksvito jeng
 
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes][HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]Wong Hoi Sing Edison
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and PackagesDamian T. Gordon
 
Ansible Project Deploy (phpbenelux 2015)
Ansible Project Deploy (phpbenelux 2015)Ansible Project Deploy (phpbenelux 2015)
Ansible Project Deploy (phpbenelux 2015)Ramon de la Fuente
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 

Similar to Montreal ansible meetup april 17th, 2019 (20)

Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm package
 
D7 as D8
D7 as D8D7 as D8
D7 as D8
 
WPSessions Composer for WordPress Plugin Development
WPSessions Composer for WordPress Plugin DevelopmentWPSessions Composer for WordPress Plugin Development
WPSessions Composer for WordPress Plugin Development
 
Bootstrap4 x pages
Bootstrap4 x pagesBootstrap4 x pages
Bootstrap4 x pages
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)
 
Eclipse Training - Introduction
Eclipse Training - IntroductionEclipse Training - Introduction
Eclipse Training - Introduction
 
Improve Your IBM Domino Designer Experience
Improve Your IBM Domino Designer ExperienceImprove Your IBM Domino Designer Experience
Improve Your IBM Domino Designer Experience
 
Effectively using Open Source with conda
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with conda
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Deep dive - Concourse CI/CD and Pipelines
Deep dive  - Concourse CI/CD and PipelinesDeep dive  - Concourse CI/CD and Pipelines
Deep dive - Concourse CI/CD and Pipelines
 
Python training
Python trainingPython training
Python training
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kite
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
 
HKG18-419 - OpenHPC on Ansible
HKG18-419 - OpenHPC on AnsibleHKG18-419 - OpenHPC on Ansible
HKG18-419 - OpenHPC on Ansible
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
 
Intellij IDEA Intro, Tips and Tricks
Intellij IDEA Intro, Tips and TricksIntellij IDEA Intro, Tips and Tricks
Intellij IDEA Intro, Tips and Tricks
 
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes][HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
 
Ansible Project Deploy (phpbenelux 2015)
Ansible Project Deploy (phpbenelux 2015)Ansible Project Deploy (phpbenelux 2015)
Ansible Project Deploy (phpbenelux 2015)
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 

More from Gonéri Le Bouder

Red Hat Ansible Lightspeed Ansible Meetup-2023-11.pdf
Red Hat Ansible Lightspeed Ansible Meetup-2023-11.pdfRed Hat Ansible Lightspeed Ansible Meetup-2023-11.pdf
Red Hat Ansible Lightspeed Ansible Meetup-2023-11.pdfGonéri Le Bouder
 
How to speed up your (API client) modules
How to speed up your (API client) modulesHow to speed up your (API client) modules
How to speed up your (API client) modulesGonéri Le Bouder
 
Virt lightning-montreal-linux-meetup-2020-02
Virt lightning-montreal-linux-meetup-2020-02Virt lightning-montreal-linux-meetup-2020-02
Virt lightning-montreal-linux-meetup-2020-02Gonéri Le Bouder
 
Ansible meetup - Québec - april 25th, 2019
Ansible meetup - Québec - april 25th, 2019Ansible meetup - Québec - april 25th, 2019
Ansible meetup - Québec - april 25th, 2019Gonéri Le Bouder
 
How to driver your webservices with ansible
How to driver your webservices with ansibleHow to driver your webservices with ansible
How to driver your webservices with ansibleGonéri Le Bouder
 
Distributed-CI - OpenStack Montréal - 2018-06
Distributed-CI - OpenStack Montréal - 2018-06Distributed-CI - OpenStack Montréal - 2018-06
Distributed-CI - OpenStack Montréal - 2018-06Gonéri Le Bouder
 
DCI presentation during OpenStack Montréal - 2018-06
DCI presentation during OpenStack Montréal - 2018-06DCI presentation during OpenStack Montréal - 2018-06
DCI presentation during OpenStack Montréal - 2018-06Gonéri Le Bouder
 
How to use TripleO tools for your own project
How to use TripleO tools for your own projectHow to use TripleO tools for your own project
How to use TripleO tools for your own projectGonéri Le Bouder
 
Fusioninventory journees-perl-2012
Fusioninventory journees-perl-2012Fusioninventory journees-perl-2012
Fusioninventory journees-perl-2012Gonéri Le Bouder
 
Otrs help desk-solutions-linux-2012
Otrs help desk-solutions-linux-2012Otrs help desk-solutions-linux-2012
Otrs help desk-solutions-linux-2012Gonéri Le Bouder
 
Fusioninventory openworldforum-paris-2011-september
Fusioninventory openworldforum-paris-2011-septemberFusioninventory openworldforum-paris-2011-september
Fusioninventory openworldforum-paris-2011-septemberGonéri Le Bouder
 
Linuxtag 2011-it-asset-management-glpi-fusioninventory
Linuxtag 2011-it-asset-management-glpi-fusioninventoryLinuxtag 2011-it-asset-management-glpi-fusioninventory
Linuxtag 2011-it-asset-management-glpi-fusioninventoryGonéri Le Bouder
 
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...Gonéri Le Bouder
 
Fusioninventory project FOSDEM 2011
Fusioninventory project FOSDEM 2011Fusioninventory project FOSDEM 2011
Fusioninventory project FOSDEM 2011Gonéri Le Bouder
 
Fusioninventory froscamp2010
Fusioninventory froscamp2010Fusioninventory froscamp2010
Fusioninventory froscamp2010Gonéri Le Bouder
 

More from Gonéri Le Bouder (20)

Red Hat Ansible Lightspeed Ansible Meetup-2023-11.pdf
Red Hat Ansible Lightspeed Ansible Meetup-2023-11.pdfRed Hat Ansible Lightspeed Ansible Meetup-2023-11.pdf
Red Hat Ansible Lightspeed Ansible Meetup-2023-11.pdf
 
How to speed up your (API client) modules
How to speed up your (API client) modulesHow to speed up your (API client) modules
How to speed up your (API client) modules
 
Virt lightning-montreal-linux-meetup-2020-02
Virt lightning-montreal-linux-meetup-2020-02Virt lightning-montreal-linux-meetup-2020-02
Virt lightning-montreal-linux-meetup-2020-02
 
Ansible meetup - Québec - april 25th, 2019
Ansible meetup - Québec - april 25th, 2019Ansible meetup - Québec - april 25th, 2019
Ansible meetup - Québec - april 25th, 2019
 
How to driver your webservices with ansible
How to driver your webservices with ansibleHow to driver your webservices with ansible
How to driver your webservices with ansible
 
Distributed-CI - OpenStack Montréal - 2018-06
Distributed-CI - OpenStack Montréal - 2018-06Distributed-CI - OpenStack Montréal - 2018-06
Distributed-CI - OpenStack Montréal - 2018-06
 
DCI presentation during OpenStack Montréal - 2018-06
DCI presentation during OpenStack Montréal - 2018-06DCI presentation during OpenStack Montréal - 2018-06
DCI presentation during OpenStack Montréal - 2018-06
 
Python + ansible = ♥
Python + ansible = ♥Python + ansible = ♥
Python + ansible = ♥
 
How to use TripleO tools for your own project
How to use TripleO tools for your own projectHow to use TripleO tools for your own project
How to use TripleO tools for your own project
 
Fusioninventory journees-perl-2012
Fusioninventory journees-perl-2012Fusioninventory journees-perl-2012
Fusioninventory journees-perl-2012
 
Otrs help desk-solutions-linux-2012
Otrs help desk-solutions-linux-2012Otrs help desk-solutions-linux-2012
Otrs help desk-solutions-linux-2012
 
Fusioninventory openworldforum-paris-2011-september
Fusioninventory openworldforum-paris-2011-septemberFusioninventory openworldforum-paris-2011-september
Fusioninventory openworldforum-paris-2011-september
 
GLPI RMLL-2011
GLPI RMLL-2011GLPI RMLL-2011
GLPI RMLL-2011
 
Fusioninventory rmll-2011
Fusioninventory rmll-2011Fusioninventory rmll-2011
Fusioninventory rmll-2011
 
Linuxtag 2011-it-asset-management-glpi-fusioninventory
Linuxtag 2011-it-asset-management-glpi-fusioninventoryLinuxtag 2011-it-asset-management-glpi-fusioninventory
Linuxtag 2011-it-asset-management-glpi-fusioninventory
 
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
 
Fusioninventory project FOSDEM 2011
Fusioninventory project FOSDEM 2011Fusioninventory project FOSDEM 2011
Fusioninventory project FOSDEM 2011
 
Fusioninventory 2010-french
Fusioninventory 2010-frenchFusioninventory 2010-french
Fusioninventory 2010-french
 
Fusioninventory froscamp2010
Fusioninventory froscamp2010Fusioninventory froscamp2010
Fusioninventory froscamp2010
 
présentation de Debian 2
présentation de Debian 2présentation de Debian 2
présentation de Debian 2
 

Recently uploaded

20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 

Recently uploaded (20)

20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 

Montreal ansible meetup april 17th, 2019

  • 1. Collections in Ansible Core Gonéri Le Bouder Senior Software Engineer, Ansible Core
  • 2. COLLECTIONS ● A new means to distribute Ansible content currently in TECH PREVIOUS ○ An artifact format for consistent content structure ○ Contains 1-N of roles, modules, plugins and module utilities ○ Enables versioning of external content ○ Enables consistent delivery independent of Ansible distributions ○ Installable as system, user or project resources ● Immediate use of the content found within the artifact ● Namespacing support built into the collection
  • 3. ● Difficult distribution of non-role content ● Plugin/role name collisions ● Difficult code-sharing for most plugins What problems do collections solve?
  • 4. ● Multiple roles with deps? Good luck. ● Roles already distribute plugins- done? ○ Requires role to be "entered" (see also ansible-wtf) ○ Plugins are not "first-class citizens" ○ Versioning/maintenance issues Problem 1: Content Distribution
  • 5. ● Collection may contain 1-N: ○ Roles/Modules/Plugins ○ Playbooks (future/TBD) ● Collection is the unit of distribution and versioning ● Installable: ○ globally ○ per-user ○ content-adjacent (ie per-project) Content Distribution with Collections
  • 6. ● Default paths (searched in this order, configurable) ○ (current playbook)/collections ○ ~/.ansible/collections ○ /usr/share/ansible/collections ● Mazer/ansible-galaxy Installing collections content
  • 7. ● Ansible has a global(ish) flat plugin namespace ● Role1 and Role2 both distribute my_module ○ Which one will get used? (ha!) ○ Can I use them both in the same run? (no) ○ What if core later includes a my_module? (screwed) ○ What if the project has in library/ ? ○ What if the user has in ~/.ansible/? ○ What if the system has in /usr/share/ansible ? ○ Issue exists for roles and all modules/plugins Problem 2: Name Collisions
  • 8. ● Collections have a namespace and name ○ For distribution, namespace == Galaxy user/org ● Content in collections is accessed by namespace ○ mynamespace.mycollection.my_module ○ f5.bigip.provisioning_role ● Built-in collections ○ ansible.builtin ○ ansible.legacy Namespacing with Collections
  • 9. - hosts: somehosts tasks: - myns.mycollection.athing: - ansible.builtin.ping: # use only the ping packaged in core - ansible.legacy.ping: # use core or library(etc)/ping.py when: thing | myns.mycollection.filter == 42 - ping: # still works, == ansible.legacy.ping: Sample playbook
  • 11. - hosts: somehosts collections: - ansible.builtin - myns.mycollection - otherns.othercollection tasks: - mymodule: # first found in the list of collections - otherns.othercollection.mymodule: # fully-qualified is fine Enter the collections keyword
  • 12. ● module_utils only works for modules ○ unless you're "in the box" ○ perverse incentives ● eg, Azure/AWS want to share utility code between ○ modules/actions/inventory/lookup plugins ● Just use pip! Problem 3: Code sharing
  • 13. ● Entire collection is a Python namespace package ● All installed collection content is accessible ○ even across collections! ○ ansible_collections root Python namespace ○ ansible_collections.mynamespace.mycollection ● PEP302 loader magic ○ collection is the smallest unit of distributed namespace Code sharing in Collections
  • 14. Demo
  • 15. ● VirtLightning: a solution to deploy VM ● Python code base, no Ansible module (yet!) ● Does not fit in the $role/library model ○ The module should be usable everywhere ○ The Inventory plugin won’t work ● Not ready for a core inclusion ○ Not mature yet ● Good candidate for a collection! Demo
  • 17. ● Experimental in 2.8 ● https://github.com/ansible/ansible/pull/52194 ● Basics are working (see PR for docs/known issues) ● Playbooks-in-collections not implemented in 2.8 ● Galaxy/Mazer/Tower support? ● Molecule, etc? Collections-in-core project status
  • 18. ● IRC #ansible and #ansible-devel ● Mailing list: Ansible-Project ● https://www.ansible.com/community Feedback wanted