|
|
|
|
|
|
|
|
- makedirs: True |
|
|
- makedirs: True |
|
|
|
|
|
|
|
|
{%- if grains['os_family'] == 'RedHat' %} |
|
|
{%- if grains['os_family'] == 'RedHat' %} |
|
|
|
|
|
{%- set boot_grub_cfg = '/boot/grub2/grub.cfg' %} |
|
|
/etc/default/grub: |
|
|
/etc/default/grub: |
|
|
file.append: |
|
|
file.append: |
|
|
- text: |
|
|
- text: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
grub_update: |
|
|
grub_update: |
|
|
cmd.wait: |
|
|
cmd.wait: |
|
|
- name: grub2-mkconfig -o /boot/grub2/grub.cfg |
|
|
|
|
|
|
|
|
- name: grub2-mkconfig -o {{ boot_grub_cfg }} |
|
|
|
|
|
|
|
|
{%- else %} |
|
|
{%- else %} |
|
|
|
|
|
{%- set boot_grub_cfg = '/boot/grub/grub.cfg' %} |
|
|
|
|
|
|
|
|
{%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %} |
|
|
|
|
|
grub_update: |
|
|
grub_update: |
|
|
cmd.wait: |
|
|
cmd.wait: |
|
|
- name: update-grub |
|
|
- name: update-grub |
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
{%- if grains.get('virtual_subtype') in ['Docker', 'LXC'] %} |
|
|
|
|
|
- onlyif: /bin/false |
|
|
|
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
|
|
|
grub_cfg_permissions: |
|
|
|
|
|
file.managed: |
|
|
|
|
|
- name: {{ boot_grub_cfg }} |
|
|
|
|
|
- user: 'root' |
|
|
|
|
|
- owner: 'root' |
|
|
|
|
|
- mode: '400' |
|
|
|
|
|
- onlyif: test -f {{ boot_grub_cfg }} |
|
|
|
|
|
- require: |
|
|
|
|
|
- cmd: grub_update |