# Use ansible to build/install kernel module

**URL:** <https://forum.ansible.com/t/use-ansible-to-build-install-kernel-module/34278>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [December 3, 2020, 5:18pm UTC](https://forum.ansible.com/t/use-ansible-to-build-install-kernel-module/34278 "2020-12-03T17:18:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Clark](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Matt\_Clark](https://forum.ansible.com/u/Matt_Clark)\
**Post date:** [December 3, 2020, 5:18pm UTC](https://forum.ansible.com/t/use-ansible-to-build-install-kernel-module/34278/1 "2020-12-03T17:18:29Z")

</div>

Hi. I’m new to the ansible world, so forgive the noob question. I need to do some post install configuration of a set of Ubuntu bionic devices and one of these things includes installing a custom kernel module from a git repo. A co-worker suggested ansible, and copying some files to /etc seems simply enough, so my question is how easy is it to use ansible to build and install the kernel module? If there’s an example to look at, I’ll happily do so. My basic work flow is this:

- clone git repo
- edit Makefile
- make dkms\_install

Thanks!

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [December 3, 2020, 6:32pm UTC](https://forum.ansible.com/t/use-ansible-to-build-install-kernel-module/34278/2 "2020-12-03T18:32:32Z")

</div>

FWIW, see the links below  
[https://ansible-linux-postinstall.readthedocs.io/en/latest/qsg.html](https://ansible-linux-postinstall.readthedocs.io/en/latest/qsg.html)

> ... set of Ubuntu bionic devices

[https://github.com/vbotka/ansible-linux-postinstall/blob/master/tasks/udev.yml](https://github.com/vbotka/ansible-linux-postinstall/blob/master/tasks/udev.yml)

> ... installing a custom kernel module from a git  
> repo.

[https://github.com/vbotka/ansible-linux-postinstall/blob/master/tasks/modules.yml](https://github.com/vbotka/ansible-linux-postinstall/blob/master/tasks/modules.yml)
