ci: Add playbook to configure container host for image prep
parent
a1b5d4941e
commit
cfbb7f884e
@ -0,0 +1,5 @@
|
||||
- name: Setup container host
|
||||
hosts: localhost
|
||||
become: true
|
||||
roles:
|
||||
- role: container_host
|
||||
@ -0,0 +1,6 @@
|
||||
- name: Update GRUB
|
||||
command: update-grub
|
||||
changed_when: true
|
||||
|
||||
- name: Reboot
|
||||
reboot:
|
||||
@ -0,0 +1,27 @@
|
||||
# > If running `docker run --rm -it centos:centos6.7 bash` immediately exits
|
||||
# > with status code 139, check to see if your system has disabled vsyscall:
|
||||
# > ...
|
||||
# > If you do not see a vsyscall mapping, and you need to run a CentOS 6
|
||||
# > container, try adding vsyscall=emulated to the kernel options.
|
||||
# > -- https://hub.docker.com/_/centos
|
||||
|
||||
- name: Check vsyscall enabled
|
||||
command:
|
||||
cmd: grep -c vsyscall /proc/self/maps
|
||||
register: grep_self_maps_result
|
||||
changed_when: false
|
||||
check_mode: false
|
||||
failed_when:
|
||||
# 0 -> match, 1 -> no match, 2 -> error
|
||||
- grep_self_maps_result.rc not in [0, 1]
|
||||
|
||||
- name: Enable vsyscall
|
||||
lineinfile:
|
||||
path: /etc/default/grub
|
||||
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT.+'
|
||||
line: GRUB_CMDLINE_LINUX_DEFAULT="quiet vsyscall=emulate"
|
||||
when:
|
||||
- grep_self_maps_result.rc != 0
|
||||
notify:
|
||||
- Update GRUB
|
||||
- Reboot
|
||||
Loading…
Reference in New Issue