handle grub cmdline more flexibly (one place for everything)

master
Simon Bruder 2019-05-19 13:57:14 +00:00
parent baa13c255b
commit d15ca1929a
No known key found for this signature in database
GPG Key ID: 6F03E0000CC5B62F
8 changed files with 26 additions and 15 deletions

View File

@ -3,5 +3,11 @@ servers:
issei:
ansible_host: issei.home.sbruder.de
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

View File

@ -5,6 +5,7 @@
- role: base
- role: dnsmasq
- role: docker
- role: grub
- role: initramfs
- role: postfix
- role: python

View File

@ -1,7 +1,4 @@
---
- name: update-grub
shell: update-grub
- name: restart-docker
systemd:
name: docker

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
---
- name: update-grub
shell: update-grub

View 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

View File

@ -0,0 +1,7 @@
---
- block:
- import_tasks: cmdline.yml
tags:
- grub:cmdline
tags:
- grub