-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made kernel updates and reboots optional and disabled by default
- Loading branch information
Showing
4 changed files
with
69 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
- name: Install backported trusty kernel onto 12.04 | ||
apt: | ||
pkg: "{{ item }}" | ||
state: "{{ kernel_pkg_state }}" | ||
update_cache: yes | ||
cache_valid_time: 600 | ||
with_items: | ||
- linux-image-generic-lts-trusty | ||
- linux-headers-generic-lts-trusty | ||
register: kernel_result | ||
when: "ansible_distribution_version|version_compare(12.04, '=')" | ||
|
||
- name: Install Xorg packages for backported kernels (very optional) | ||
apt: | ||
pkg: "{{ item }}" | ||
state: installed | ||
update_cache: yes | ||
cache_valid_time: 600 | ||
with_items: | ||
- xserver-xorg-lts-trusty | ||
- libgl1-mesa-glx-lts-trusty | ||
register: xorg_pkg_result | ||
when: "install_xorg_pkgs and (kernel_result|changed or kernel_result|success)" | ||
|
||
- name: Install latest kernel extras for Ubuntu 13.04+ | ||
apt: | ||
pkg: "linux-image-extra-{{ ansible_kernel }}" | ||
state: "{{ kernel_pkg_state }}" | ||
update_cache: yes | ||
cache_valid_time: 600 | ||
when: "ansible_distribution_version|version_compare(13.04, '=') | ||
or ansible_distribution_version|version_compare(13.10, '=') | ||
or install_kernel_extras" | ||
|
||
# Fix for https://github.com/dotcloud/docker/issues/4568 | ||
- name: Install cgroup-lite for Ubuntu 13.10 | ||
apt: | ||
pkg: cgroup-lite | ||
state: "{{ cgroup_lite_pkg_state }}" | ||
update_cache: yes | ||
cache_valid_time: 600 | ||
register: cgroup_lite_result | ||
when: "ansible_distribution_version|version_compare(13.10, '=')" | ||
|
||
- name: Reboot instance | ||
command: /sbin/shutdown -r now | ||
register: reboot_result | ||
when: "(ansible_distribution_version|version_compare(12.04, '=') and kernel_result|changed) | ||
or (ansible_distribution_version|version_compare(13.10, '=') and cgroup_lite_result|changed) | ||
or xorg_pkg_result|changed" | ||
|
||
- name: Wait for instance to come online (10 minute timeout) | ||
sudo: false | ||
local_action: | ||
module: wait_for | ||
host: "{{ ansible_ssh_host|default(inventory_hostname) }}" | ||
port: "{{ ansible_ssh_port|default(ssh_port) }}" | ||
delay: 30 | ||
timeout: 600 | ||
state: started | ||
when: "(ansible_distribution_version|version_compare(12.04, '=') and reboot_result|changed) | ||
or (ansible_distribution_version|version_compare(13.10, '=') and cgroup_lite_result|changed)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters