SlideShare a Scribd company logo
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 package
Andrii Lundiak
 
D7 as D8
D7 as D8D7 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
Caldera Labs
 
Bootstrap4 x pages
Bootstrap4 x pagesBootstrap4 x pages
Bootstrap4 x pages
Philippe Riand
 
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 - Introduction
Luca D'Onofrio
 
Improve Your IBM Domino Designer Experience
Improve Your IBM Domino Designer ExperienceImprove Your IBM Domino Designer Experience
Improve Your IBM Domino Designer Experience
panagenda
 
Effectively using Open Source with conda
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with conda
Travis Oliphant
 
Mono Repo
Mono RepoMono Repo
Mono Repo
Zacky Pickholz
 
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
Syed Imam
 
Python training
Python trainingPython training
Python training
Kunalchauhan76
 
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
Christian Opitz
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
RohitKumar639388
 
HKG18-419 - OpenHPC on Ansible
HKG18-419 - OpenHPC on AnsibleHKG18-419 - OpenHPC on Ansible
HKG18-419 - OpenHPC on Ansible
Linaro
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
Ivan Serdyuk
 
Intellij IDEA Intro, Tips and Tricks
Intellij IDEA Intro, Tips and TricksIntellij IDEA Intro, Tips and Tricks
Intellij IDEA Intro, Tips and Tricks
vito 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 Packages
Damian 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 composer
nuppla
 

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.pdf
Goné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) modules
Goné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-02
Goné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, 2019
Goné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 ansible
Goné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-06
Goné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-06
Gonéri Le Bouder
 
Python + ansible = ♥
Python + ansible = ♥Python + ansible = ♥
Python + ansible = ♥
Goné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 project
Gonéri Le Bouder
 
Fusioninventory journees-perl-2012
Fusioninventory journees-perl-2012Fusioninventory journees-perl-2012
Fusioninventory journees-perl-2012
Goné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-2012
Gonéri Le Bouder
 
Fusioninventory openworldforum-paris-2011-september
Fusioninventory openworldforum-paris-2011-septemberFusioninventory openworldforum-paris-2011-september
Fusioninventory openworldforum-paris-2011-september
Gonéri Le Bouder
 
GLPI RMLL-2011
GLPI RMLL-2011GLPI RMLL-2011
GLPI RMLL-2011
Gonéri Le Bouder
 
Fusioninventory rmll-2011
Fusioninventory rmll-2011Fusioninventory rmll-2011
Fusioninventory rmll-2011
Goné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-fusioninventory
Goné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 2011
Gonéri Le Bouder
 
Fusioninventory 2010-french
Fusioninventory 2010-frenchFusioninventory 2010-french
Fusioninventory 2010-french
Gonéri Le Bouder
 
Fusioninventory froscamp2010
Fusioninventory froscamp2010Fusioninventory froscamp2010
Fusioninventory froscamp2010
Gonéri Le Bouder
 
présentation de Debian 2
présentation de Debian 2présentation de Debian 2
présentation de Debian 2
Goné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

Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
902basic
 
To Avoid Mistakes When Using Online Attendance Sheets
To Avoid Mistakes When Using Online Attendance SheetsTo Avoid Mistakes When Using Online Attendance Sheets
To Avoid Mistakes When Using Online Attendance Sheets
Task Tracker
 
HIRE A HACKER FOR CHEATING HUSBAND/WIFE)
HIRE A HACKER FOR CHEATING HUSBAND/WIFE)HIRE A HACKER FOR CHEATING HUSBAND/WIFE)
HIRE A HACKER FOR CHEATING HUSBAND/WIFE)
josephinedrea942
 
NYGGS 360: A Complete ERP for Construction Innovation
NYGGS 360: A Complete ERP for Construction InnovationNYGGS 360: A Complete ERP for Construction Innovation
NYGGS 360: A Complete ERP for Construction Innovation
NYGGS Construction ERP Software
 
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
kiara pandey
 
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
87tomato
 
Independent Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class H...
Independent Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class H...Independent Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class H...
Independent Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class H...
aslasdfmkhan4750
 
The Ultimate Guide to Phone Spy Apps: Everything You Need to Know
The Ultimate Guide to Phone Spy Apps: Everything You Need to KnowThe Ultimate Guide to Phone Spy Apps: Everything You Need to Know
The Ultimate Guide to Phone Spy Apps: Everything You Need to Know
onemonitarsoftware
 
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
rachitkumar09887
 
welcome to presentation on Google Apps
welcome to   presentation on Google Appswelcome to   presentation on Google Apps
welcome to presentation on Google Apps
AsifKarimJim
 
GT degree offer diploma Transcript
GT degree offer diploma TranscriptGT degree offer diploma Transcript
GT degree offer diploma Transcript
attueb
 
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
45unexpected
 
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptxWired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
SimonedeGijt
 
Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …
908dutch
 
Artificial intelligence in customer services or chatbots
Artificial intelligence  in customer services or chatbotsArtificial intelligence  in customer services or chatbots
Artificial intelligence in customer services or chatbots
kayash1656
 
Girls Call Jogeshwari 9967584737 Provide Best And Top Girl Service And No1 in...
Girls Call Jogeshwari 9967584737 Provide Best And Top Girl Service And No1 in...Girls Call Jogeshwari 9967584737 Provide Best And Top Girl Service And No1 in...
Girls Call Jogeshwari 9967584737 Provide Best And Top Girl Service And No1 in...
simran hot girls
 
Amadeus Travel API, Amadeus Booking API, Amadeus GDS
Amadeus Travel API, Amadeus Booking API, Amadeus GDSAmadeus Travel API, Amadeus Booking API, Amadeus GDS
Amadeus Travel API, Amadeus Booking API, Amadeus GDS
aadhiyaeliza
 
當測試開始左移
當測試開始左移當測試開始左移
當測試開始左移
Jersey (CHE-PING) Su
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
akshesh doshi
 
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
jealousviolet
 

Recently uploaded (20)

Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
 
To Avoid Mistakes When Using Online Attendance Sheets
To Avoid Mistakes When Using Online Attendance SheetsTo Avoid Mistakes When Using Online Attendance Sheets
To Avoid Mistakes When Using Online Attendance Sheets
 
HIRE A HACKER FOR CHEATING HUSBAND/WIFE)
HIRE A HACKER FOR CHEATING HUSBAND/WIFE)HIRE A HACKER FOR CHEATING HUSBAND/WIFE)
HIRE A HACKER FOR CHEATING HUSBAND/WIFE)
 
NYGGS 360: A Complete ERP for Construction Innovation
NYGGS 360: A Complete ERP for Construction InnovationNYGGS 360: A Complete ERP for Construction Innovation
NYGGS 360: A Complete ERP for Construction Innovation
 
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
 
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
 
Independent Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class H...
Independent Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class H...Independent Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class H...
Independent Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class H...
 
The Ultimate Guide to Phone Spy Apps: Everything You Need to Know
The Ultimate Guide to Phone Spy Apps: Everything You Need to KnowThe Ultimate Guide to Phone Spy Apps: Everything You Need to Know
The Ultimate Guide to Phone Spy Apps: Everything You Need to Know
 
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
 
welcome to presentation on Google Apps
welcome to   presentation on Google Appswelcome to   presentation on Google Apps
welcome to presentation on Google Apps
 
GT degree offer diploma Transcript
GT degree offer diploma TranscriptGT degree offer diploma Transcript
GT degree offer diploma Transcript
 
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
 
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptxWired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
 
Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …
 
Artificial intelligence in customer services or chatbots
Artificial intelligence  in customer services or chatbotsArtificial intelligence  in customer services or chatbots
Artificial intelligence in customer services or chatbots
 
Girls Call Jogeshwari 9967584737 Provide Best And Top Girl Service And No1 in...
Girls Call Jogeshwari 9967584737 Provide Best And Top Girl Service And No1 in...Girls Call Jogeshwari 9967584737 Provide Best And Top Girl Service And No1 in...
Girls Call Jogeshwari 9967584737 Provide Best And Top Girl Service And No1 in...
 
Amadeus Travel API, Amadeus Booking API, Amadeus GDS
Amadeus Travel API, Amadeus Booking API, Amadeus GDSAmadeus Travel API, Amadeus Booking API, Amadeus GDS
Amadeus Travel API, Amadeus Booking API, Amadeus GDS
 
當測試開始左移
當測試開始左移當測試開始左移
當測試開始左移
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
 
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
 

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