aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/kernel/tasks/ubuntu_bionic.yaml
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2020-04-03 08:14:50 +0000
committerPeter Mikus <pmikus@cisco.com>2020-04-09 11:00:33 +0000
commit8fcb84c0495e364daf65745a9b23b0d6f0a1d51e (patch)
treeda56330e5424c5c3a5bc323dc83dda13aac4e58a /resources/tools/testbed-setup/ansible/roles/kernel/tasks/ubuntu_bionic.yaml
parent8e3a326cba182b4ab9054263625c7e40cdd6f2e3 (diff)
Ansible: Kernel installation
Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: Iee65272169339ed0e5561cf3dee11567335b12be
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/kernel/tasks/ubuntu_bionic.yaml')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/kernel/tasks/ubuntu_bionic.yaml44
1 files changed, 44 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/kernel/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/kernel/tasks/ubuntu_bionic.yaml
new file mode 100644
index 0000000000..c9c561df6f
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/kernel/tasks/ubuntu_bionic.yaml
@@ -0,0 +1,44 @@
+---
+# file: roles/kernel/tasks/ubuntu_bionic.yaml
+
+- name: Kernel - Get Available Kernel Versions
+ command: "apt-cache showpkg linux-headers-*"
+ changed_when: false
+ register: apt_kernel_list
+ tags: install-kernel
+
+- name: Kernel - Get installed packages with APT
+ command: "dpkg -l"
+ changed_when: false
+ register: apt_packages_list
+ tags: install-kernel
+
+- name: Kernel - Set target APT kernel version
+ set_fact:
+ _kernel: "{{ apt_kernel_list | deb_kernel(
+ kernel_version, ansible_kernel) }}"
+ tags: install-kernel
+
+- name: Kernel - Ensure Packages Versions
+ apt:
+ name: "{{ apt_kernel_list | deb_kernel_pkg(
+ kernel_version, ansible_kernel, ansible_distribution,
+ ansible_architecture, item) }}"
+ loop: "{{ kernel_packages }}"
+ tags: install-kernel
+
+- name: Kernel - Ensure Any Other Kernel Packages Are Removed
+ apt:
+ name: "{{ apt_packages_list | deb_installed_kernel(
+ apt_kernel_list, kernel_version, ansible_kernel) }}"
+ state: absent
+ purge: true
+ tags: install-kernel
+
+- name: Kernel - Ensure Any Microcode Is Absent
+ apt:
+ name: "{{ absent_packages }}"
+ state: absent
+ purge: true
+ tags: install-kernel
+