---
# System prepended metadata

title: State of Ansible packaging

---

---
# How this works: https://hackmd.io/s/how-to-create-slide-deck
title: State of Ansible packaging
type: slide
slideOptions:
  transition: slide
---

## State of Ansible packaging
#### Ansible Contributor Summit, April 2022

---

## About this presentation
#### High level overview
<!-- dmsimard -->

- What are the different packages
- Available stats and metrics
- How packages are built and distributed
- Challenges and opportunities
- A reference we can look back to in the future

---

## Introductions
<!-- Everyone -->

- David Moreau-Simard (@dmsimard)
- Dimitri Savineau (@dsavineau)
- Fabian Arrotin (@arrfab)
- Kevin Fenzi (@nirik)
- Ompragash Viswanathan (@ompragash)
- Paul Belanger (@pabelanger)

---

<!-- dmsimard -->

#### About ``ansible`` and ~~ansible-base~~ ``ansible-core``

![image](https://ansible.github.io/community/decks/images/3.0.0-community-update/twitter.png)

---

## ~~ansible-base~~ ansible-core
#### runtime and language
<!-- dmsimard -->

- https://github.com/ansible/ansible
- CLI: ansible (ad-hoc), ansible-playbook
- CLI: ansible-galaxy, ansible-test
- ansible.builtin modules and plugins

----

## ~~ansible-base~~ ansible-core
#### runtime and language
<!-- dmsimard -->

- Latest releases: 2.11.x, 2.12.x
- 2.13.0 in May 2022
- Minor release every month
- Major release every 6 months

---

## ansible
#### "batteries included"
<!-- dmsimard -->

- Depends on the latest version of ansible-core
- Includes a set of curated Ansible collections

```
ansible_collections/
├── amazon.aws
├── ansible.posix
├── azure.azcollection
├── community.general
├── community.mysql
├── community.postgresql
├── kubernetes.core
├── openstack.cloud
├── theforeman.foreman
└── # ...
```

----

## ansible
#### "batteries included"
<!-- dmsimard -->

- Latest release: 5.x with ansible-core 2.12.x
- 6.0.0 with ansible-core 2.13.0 in May 2022
- Minor release every 3 weeks
- Major release every 6 months

---

# End of life
<!-- dmsimard -->

May 2022: [ansible 2.9 and ansible-base 2.10](https://groups.google.com/g/ansible-announce/c/kegIH5_okmg/)

---

# Some stats
#### (for science)
<!-- dmsimard -->

----

## PyPI: per distribution
### ansible(-base|-core)>=2.9
```
| distro              |ansible  |ansible-base|ansible-core|
|---------------------|---------|------------|------------|
| Amazon              |27106716 |8855076     |7547751     |
| Ubuntu              |24931948 |6696220     |5324968     |
| CentOS              |17377027 |1104388     |891961      |
| Debian              |6192428  |1668373     |1239696     |
| RHEL                |2179101  |706074      |391305      |
| Alpine Linux        |1532631  |512919      |251529      |
| Fedora              |832052   |240668      |250804      |
| macOS               |686813   |168982      |177985      |
| Oracle Linux Server |385920   |86036       |239633      |
| SLES                |68189    |8754        |12925       |
```

##### *Source: https://packaging.python.org/en/latest/guides/analyzing-pypi-package-downloads/* (March 2022)

----

## PyPI: per python version
### ansible>=2.9
```
| python | 04/21 - 03/22 | 04/20 - 03/21 | 04/19 - 03/20 |
|--------|---------------|---------------|---------------|
| 2.7    | 18763175      | 15577986      | 2161368       |
| 3.6    | 7509527       | 9230032       | 5668356       |
| 3.7    | 6221052       | 3047679       | 756354        |
| 3.8    | 5150328       | 2650615       | 164586        |
| 3.9    | 2326883       | 603360        | 240           |
```

##### *Source: https://packaging.python.org/en/latest/guides/analyzing-pypi-package-downloads/* (March 2022)

----

## PyPI: per python version
### ansible-base (2.10)
```
| python | 04/21 - 03/22 | 04/20 - 03/21 |
|--------|---------------|---------------|
| 2.7    | 6625968       | 3052754       |
| 3.6    | 1392764       | 1594047       |
| 3.7    | 903089        | 2628907       |
| 3.8    | 1074490       | 1457325       |
| 3.9    | 467096        | 738809        |
```

##### *Source: https://packaging.python.org/en/latest/guides/analyzing-pypi-package-downloads/* (March 2022)

----

## PyPI: per python version
### ansible-core (>=2.11)
```
| python | 04/21 - 03/22 | 04/20 - 03/21 |
|--------|---------------|---------------|
| 2.7    | 8679904       | 180           |
| 3.6    | 1697628       | 389           |
| 3.7    | 1938293       | 73            |
| 3.8    | 2355303       | 290           |
| 3.9    | 1179747       | 302           |
```

##### *Source: https://packaging.python.org/en/latest/guides/analyzing-pypi-package-downloads/* (March 2022)

---

## Distribution packages

---

## PyPI
<!-- dmsimard/dsavineau -->

----

## PyPI: ansible
#### https://pypi.org/project/ansible/

``pip install --user ansible``

Built with [antsibull](https://github.com/ansible-community/antsibull) and [ansible-build-data](https://github.com/ansible-community/ansible-build-data)

----

## PyPI: ansible
#### What's new in 6.x

- Installation performance improvements:
  - Python wheels !
  - No longer installing unnecessary files
    (dotfiles, tests, etc)

----

```bash
> time pip install "ansible<6" # ansible 5.6.0
# ...
Executed in  100.44 secs    fish           external
   usr time   85.61 secs    0.00 micros   85.61 secs
   sys time   13.19 secs  549.00 micros   13.19 secs

> time pip install "ansible==6.0.0a1" # + ansible-core 2.13
# ...
Executed in   26.95 secs    fish           external
   usr time   21.20 secs    0.00 micros   21.20 secs
   sys time    2.09 secs  640.00 micros    2.09 secs
```

----

## PyPI: ansible-core
#### https://pypi.org/project/ansible-core/

``pip install --user ansible-core``

----

## PyPI: ansible-core
#### What's new in 2.13

- Python wheels on PyPI !
- Jinja2 >= 3.0.0 is required for the controller
- Python 2.6 support is dropped for modules

https://github.com/ansible/ansible/blob/stable-2.13/changelogs/CHANGELOG-v2.13.rst

---

## Fedora
<!-- dmsimard/nirik -->

----

## Fedora: ansible

``dnf install ansible``

- [Updating Ansible 2.9 to 5](https://fedoraproject.org/wiki/Changes/Ansible5)
- [Some individually packaged collections](https://koji.fedoraproject.org/koji/search?match=glob&type=package&terms=ansible-collection*)
- [Fedora infra upgrade from 2.9](https://pagure.io/fedora-infrastructure/issue/10287)
- [ansible RPM spec](https://src.fedoraproject.org/rpms/ansible)
- [ansible on koji](https://koji.fedoraproject.org/koji/packageinfo?packageID=13842)

----

## Fedora: ansible-core

``dnf install ansible-core``

- [ansible-core RPM spec](https://src.fedoraproject.org/rpms/ansible-core)
- [ansible-core on koji](https://koji.fedoraproject.org/koji/packageinfo?packageID=33489)

---

## CentOS / EPEL
#### && Configuration Management SIG

----

## RHEL / CentOS Stream EPEL: ansible
<!-- dmsimard/nirik -->

- Updating ``ansible`` in EPEL8/EPEL9
- Need to match python version with ansible-core
- Dependencies needing to be built with py38

Some conflicts with the new ansible-core:
- https://lists.centos.org/pipermail/centos-devel/2022-April/120307.html
- https://bugzilla.redhat.com/show_bug.cgi?id=2068558

----

## CentOS ecosystem / Configuration Management SIG
<!-- dmsimard/arrfab -->

- https://pagure.io/centos-infra/issue/496
  - python 3.8 rpm packaging challenge
  - callback plugin to be bumped
  - [ansible meta-pkg for collections](https://git.centos.org/rpms/ansible/tree/c8-sig-configmanagement-ansible-5)

----

## CentOS ecosystem / Configuration Management SIG
<!-- dmsimard/arrfab -->

- useful packages :
  - [ansible-roles-ctl](https://gitlab.com/osci/ansible-roles-ctl) (not built yet)
  - ara (already done but python version mismatch)
  - ansible (meta-pkg : 5.6.0 rpm pkg built today, needs to target el9)
  

----

## CentOS configmanagement SIG
<!-- dmsimard/arrfab -->
Possible right now (in -testing): 
```
dnf install centos-release-ansible-5 \
dnf install ansible --enablerepo=centos-ansible-5-testing

Installing:
 ansible                        noarch      5.6.0-2.el8                                    @commandline       39 M
Installing dependencies:
 ansible-core                   x86_64      2.12.3-1.el8                                   appstream         2.5 M

```

----

## RHEL / CentOS Stream: ansible-core
<!-- dmsimard/dsavineau -->

- ansible-core included via RHEL 8.6 and RHEL 9.0

- [ansible-core RPM spec (centos-stream 8)](https://git.centos.org/rpms/ansible-core)
- [ansible-core RPM spec (centos-stream 9)](https://gitlab.com/redhat/centos-stream/rpms/ansible-core)
- [ansible-core on koji (centos-stream 8)](https://koji.mbox.centos.org/koji/packageinfo?packageID=3337)
- [ansible-core on koji (centos-stream 9)](https://kojihub.stream.centos.org/koji/packageinfo?packageID=3480)

----

## Ansible Automation Platform (AAP): ansible-core
<!-- dmsimard/dsavineau -->

- AAP 2.0: ansible-core 2.11 (python 3.8)
- AAP 2.1: ansible-core 2.12 (python 3.8)
- AAP 2.2: ansible-core 2.13 (python 3.9)

---

## Ubuntu
<!-- ompragash -->

----

## Ubuntu: PPA

- Follows [PyPi - Ansible](https://pypi.org/project/ansible/#history) Release schedule

- PPA packages are built using [ansible-community/ppa](https://github.com/ansible-community/ppa)

- Build process overview

- Need newer version of resolvlib

- Ansible PPA Launchpad [link](https://launchpad.net/~ansible)

- Per-version PPA repository

- [Want to contribute?](https://github.com/ansible-community/ppa/issues/1)

---

## Debian

----

## Debian

- https://salsa.debian.org/debian/ansible
- https://salsa.debian.org/debian/ansible-core

---

## Others
#### *but wait... there's more!*

----

## Alpine

- https://pkgs.alpinelinux.org/package/edge/community/x86_64/ansible
- https://pkgs.alpinelinux.org/package/edge/community/x86_64/ansible-core

----

## SUSE

- https://build.opensuse.org/package/show/systemsmanagement/ansible
- ~~https://build.opensuse.org/package/show/systemsmanagement/ansible-core~~

----

## Gentoo

- https://packages.gentoo.org/packages/app-admin/ansible
- https://packages.gentoo.org/packages/app-admin/ansible-base

----

## Arch

- https://archlinux.org/packages/community/any/ansible/
- https://archlinux.org/packages/community/any/ansible-core/

----

## NixOS

- https://github.com/NixOS/nixpkgs/tree/nixos-21.11/pkgs/development/python-modules/ansible

---

<!-- dmsimard -->

## Thank You!
### Any questions?

#### Stay up to date:

- [The Bullhorn](https://us19.campaign-archive.com/home/?u=56d874e027110e35dea0e03c1&id=d6635f5420) Ansible newsletter
- [ansible-announce](https://groups.google.com/g/ansible-announce/) mailing list

--

#### Come chat:

- [#ansible-packaging](https://web.libera.chat/?channel=#ansible-packaging) on libera.chat (IRC)
- [#packaging:ansible.com](https://matrix.to/#/#packaging:ansible.com) on Matrix

---