aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml')
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml51
1 files changed, 51 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml
new file mode 100755
index 00000000..6d4ca035
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml
@@ -0,0 +1,51 @@
+---
+#- hosts: all
+# sudo: yes
+# tasks:
+- name: "install Ubuntu kernel"
+# sudo: True
+# apt:
+# name: "linux-headers-3.13.0-40"
+# name: "linux-headers-3.13.0-40-generic"
+# name: "linux-image-3.13.0-40-generic"
+# name: "linux-image-extra-3.13.0-40-generic"
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: kernel_packages | union(kernel_packages_noarch)
+ when: (kernel_install) and (ansible_kernel != kernel_required)
+
+- name: "setup grub"
+# sudo: True
+ lineinfile:
+ dest: "/etc/default/grub"
+ regexp: "GRUB_DEFAULT=.*"
+ line: "GRUB_DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux 3.13.0-40-generic'"
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ when: (kernel_install) and (ansible_kernel != kernel_required)
+
+- name: "reflect grub"
+# sudo: True
+ shell: "update-grub2"
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ when: (kernel_install) and (ansible_kernel != kernel_required)
+
+- name: "reboot Server"
+# sudo: True
+ shell: "shutdown -r now"
+ async: 0
+ poll: 0
+ ignore_errors: true
+ notify: Wait for server to come back
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ when: (kernel_install) and (ansible_kernel != kernel_required)
+
+handlers:
+- name: "Wait for server to come back"
+ local_action:
+ module: wait_for
+ host={{ inventory_hostname }}
+ port=22
+ delay=30
+ timeout=600
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ when: (kernel_install) and (ansible_kernel != kernel_required)