yum_tasks
Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
- Puppet >= 5.5.10 < 7.0.0
- Oracle Enterprise Linux, RedHat, CentOS
Plans:
- package_cache
- security_cache
Start using this module
Documentation
yum_tasks
Table of Contents
- Description
- New to bolt?
- Gotchas/Limitations
- Usage - Examples and general tips on how to use the content in this module
- Contributions - Guide for contributing to the module
Description
These tasks help interact with yum at various levels via Puppet Bolt or Puppet Enterprise tasks.
New to bolt?
Check these out:
Newcomers quickstart
Create a Bolt project + Boltdir > Create Puppetfile + Add this module > Install module > Run tasks! :)
mkdir -p bolt/Boltdir/
cd bolt/Boltdir/
cat << EOF >> Puppetfile
# Modules from the Puppet Forge.
mod 'kinners00-yum_tasks', '1.0.0'
EOF
bolt puppetfile install
Gotchas
Bolt tasks are copied and executed under /tmp
If you can't execute scripts under that directory, you can pass --tmpdir
flag on your bolt command followed by your chosen directory for example --tmpdir /var/tmp
Pass 'run as root' parameter
Depending on your targets user level permissions, you may have to pass --run-as root
on your bolt command or add run-as: root
to your config in your inventory.yaml
file.
Security related tasks only work on RHEL + OEL
yum_tasks::security
, yum_tasks::cve
and yum_tasks::advisory
tasks will only work if you have the relevant security metadata repos enabled.
To the best of my knowledge, this effectively limits this task to RHEL and OEL boxes. It will look like it works on centos etc (i.e. executes successfully) but it will never "find" any security updates if the corresponding repo isn't there.
Usage
Show all available yum tasks
Will show all tasks that match the module name yum_tasks
.
bolt task show --filter yum_tasks
Show task info/metadata
This will show a brief description of the tasks function as well the parameters that the task can consume.
bolt task show yum_tasks::security
Running a task
Pass in the relevant parameters and run the task.
bolt task run --targets rhelboxes yum_tasks::security security=minimal
Plan example
If you a bolt aficionado, you can ignore this section.
I've included two sample plans to demonstrate how you can chain together tasks to achieve an overall workflow. In these plans we are running the cache task followed by either a security or install package task, depending on which plan you run. Plans can be made up of tasks from other modules too.
You can see the content of security_cache
plan below:
plan yum_tasks::security_cache(
TargetSpec $targets,
String $cache,
String $security
) {
run_task('yum_tasks::update_cache', $targets, cache => $cache)
run_task('yum_tasks::security', $targets, security => $security)
}
Running plans
(Optional) Add --verbose
to the end of your bolt command to get output from each task in the plan.
bolt plan run yum_tasks::security_cache targets=rhelboxes cache=update security=minimal --verbose
bolt plan run yum_tasks::package_cache targets=rhelboxes cache=update package=nano --verbose
Contributions
This module contains a simple set of tasks (written in bash). The logic on some tasks could be smarter/cleaner but they should all work. I will get round to improving them at some point in the near future.
If anyone would like to contribute to the module, that would be awesome and very much welcomed.
If you're experiencing any bugs, please raise an issue below:
Repo: https://github.com/kinners00/yum_tasks/issues
Issues link: https://github.com/kinners00/yum_tasks/issues
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Tasks in this module release
What are plans?
Modules can contain plans that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.