handle grub cmdline more flexibly (one place for everything)
This commit is contained in:
parent
baa13c255b
commit
d15ca1929a
|
@ -3,5 +3,11 @@ servers:
|
||||||
issei:
|
issei:
|
||||||
ansible_host: issei.home.sbruder.de
|
ansible_host: issei.home.sbruder.de
|
||||||
ansible_user: root
|
ansible_user: root
|
||||||
vars:
|
|
||||||
debian_release: buster
|
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: base
|
||||||
- role: dnsmasq
|
- role: dnsmasq
|
||||||
- role: docker
|
- role: docker
|
||||||
|
- role: grub
|
||||||
- role: initramfs
|
- role: initramfs
|
||||||
- role: postfix
|
- role: postfix
|
||||||
- role: python
|
- role: python
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
---
|
---
|
||||||
- name: update-grub
|
|
||||||
shell: update-grub
|
|
||||||
|
|
||||||
- name: restart-docker
|
- name: restart-docker
|
||||||
systemd:
|
systemd:
|
||||||
name: docker
|
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
|
- import_tasks: packages.yml
|
||||||
tags:
|
tags:
|
||||||
- docker:packages
|
- docker:packages
|
||||||
- import_tasks: kernel.yml
|
|
||||||
tags:
|
|
||||||
- docker:kernel
|
|
||||||
- import_tasks: config.yml
|
- import_tasks: config.yml
|
||||||
tags:
|
tags:
|
||||||
- docker:config
|
- 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