Version information
This version is compatible with:
- Puppet Enterprise 2025.2.x, 2025.1.x, 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2021.7.x
- Puppet >= 7.24 < 9.0.0
- , , , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'avitacco-cni_plugins', '1.1.0'
Learn more about managing modules with a PuppetfileDocumentation
cni_plugins
This module provides a simple way to install and update the CNI plugins from the Cloud Native Computing Foundation.
Table of Contents
- Description
- Setup - The basics of getting started with cni_plugins
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
This module will allow you to install and update the CNI plugins from CNCF. It maintains versions in a way that will allow for easy roll-back.
Setup
What cni_plugins affects
This module creates and manages the directory where the plugins are installed.
By default this is /opt/cni
. It also manages the bin/
directory, as a
symlink, inside of the main directory. The CNI plugins are extracted to a
versioned directory inside the main directory. The bin
directory is then
linked to the specified version.
By default this looks like this
/opt/cni # Install root, managed by module
/opt/cni/1.6.2 # Versioned directory where bins are stored
/opt/cni/bin # Symlink to specified version
Beginning with cni_plugins
The most basic usage of this module would look like below
class { 'cni_plugins': }
Usage
Some more complex use-cases could look like the following
Use a specific version of the CNI plugins
class { 'cni_plugins':
version => '1.2.0,
}
Install in a non-default place
class { 'cni_plugins':
install_root => '/var/lib/cni',
}
Change the owner of the directory
class { 'cni_plugins':
owner => 'nobody',
group => 'nobody',
}
Limitations
This module could cause other modules to install binaries in the cni bin directory when upgrading versions. This is because the symlink is changed to a new directory where the existing binary won't be installed.
This module also does not support proxies nor does it allow for changing the URL where the packages could be downloaded. I will gladly accept PRs that solve either or both of these limitations.
Development
PRs are welcome for this project. They must be accompanied by an issue describing the problem they are solving. All code must also pass and include unit tests and/or acceptance tests.
Any code contributed to this project must follow PDK coding conventions.
#
# Basic validations
#
pdk validate
pdk test unit --parallel
#
# Acceptance (litmus) testing, requires docker
#
pdk bundle exec rake 'litmus:provision_list[default]'
pdk bundle exec rake 'litmus:install_agent'
pdk bundle exec rake 'litmus:install_module'
pdk bundle exec rake 'litmus:acceptance:parallel'
pdk bundle exec rake 'litmus:tear_down'
Reference
Table of Contents
Classes
cni_plugins
: This is the main (and currently only) class for managing CNI plugins for the CNI plugins module
Classes
cni_plugins
This class downloads, extracts, and manages versions for the CNI plugins archives.
Examples
include cni_plugins
Parameters
The following parameters are available in the cni_plugins
class:
version
Data type: String
The version of the CNI plugins to install (default: 1.7.1)
Default value: '1.7.1'
install_root
Data type: Stdlib::Absolutepath
The root into which the cni plugins should be installed (default: /opt/cni)
Default value: '/opt/cni'
install_root_mode
Data type: Stdlib::Filemode
The permissions to give the install root directory (default: 0755)
Default value: '0755'
install_root_owner
Data type: String
The owner for the install root directory (default: root)
Default value: 'root'
install_root_group
Data type: String
The group for the install root directory (default: root)
Default value: 'root'
Dependencies
- puppetlabs/stdlib (>=4.13.0 < 10.0.0)
- puppet/archive (>= 6.0.0 < 8.0.0)
The MIT License (MIT) ===================== Copyright © 2025 Anthony Vitacco Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.