handle grub cmdline more flexibly (one place for everything)
This commit is contained in:
parent
baa13c255b
commit
d15ca1929a
|
@ -3,5 +3,11 @@ servers:
|
|||
issei:
|
||||
ansible_host: issei.home.sbruder.de
|
||||
ansible_user: root
|
||||
vars:
|
||||
|
||||
debian_release: buster
|
||||
initramfs:
|
||||
network:
|
||||
address: 192.168.100.90
|
||||
gateway: 192.168.100.1
|
||||
netmask: 255.255.255.0
|
||||
interface: enp0s25
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
- role: base
|
||||
- role: dnsmasq
|
||||
- role: docker
|
||||
- role: grub
|
||||
- role: initramfs
|
||||
- role: postfix
|
||||
- role: python
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
---
|
||||
- name: update-grub
|
||||
shell: update-grub
|
||||
|
||||
- name: restart-docker
|
||||
systemd:
|
||||
name: docker
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
- name: add boot parameters for docker
|
||||
lineinfile:
|
||||
path: /etc/default/grub
|
||||
regexp: ^GRUB_CMDLINE_LINUX_DEFAULT=
|
||||
line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1"'
|
||||
notify: update-grub
|
|
@ -3,9 +3,6 @@
|
|||
- import_tasks: packages.yml
|
||||
tags:
|
||||
- docker:packages
|
||||
- import_tasks: kernel.yml
|
||||
tags:
|
||||
- docker:kernel
|
||||
- import_tasks: config.yml
|
||||
tags:
|
||||
- docker:config
|
||||
|
|
3
roles/grub/handlers/main.yml
Normal file
3
roles/grub/handlers/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- name: update-grub
|
||||
shell: update-grub
|
7
roles/grub/tasks/cmdline.yml
Normal file
7
roles/grub/tasks/cmdline.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- name: add boot parameters for docker
|
||||
lineinfile:
|
||||
path: /etc/default/grub
|
||||
regexp: ^GRUB_CMDLINE_LINUX_DEFAULT=
|
||||
line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1{% if initramfs.network %} ip={{ initramfs.network.address }}::{{ initramfs.network.gateway }}:{{ initramfs.network.netmask }}:{{ inventory_hostname }}:{{ initramfs.network.interface }}:off{% endif %}"'
|
||||
notify: update-grub
|
7
roles/grub/tasks/main.yml
Normal file
7
roles/grub/tasks/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- block:
|
||||
- import_tasks: cmdline.yml
|
||||
tags:
|
||||
- grub:cmdline
|
||||
tags:
|
||||
- grub
|
Reference in a new issue