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

原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 

Recently uploaded (20)

原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 

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