]> git.somenet.org - root/pub/somesible.git/blob - roles/base/grub/tasks/main.yml
[roles/util] ----- meta ----- No dependencies
[root/pub/somesible.git] / roles / base / grub / tasks / main.yml
1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
6 #
7 ---
8 - name: install needed tools
9   apt:
10     pkg:
11       - "{{grub_pkg}}"
12       - "grub-pc-bin"
13     state: present
14     policy_rc_d: 101
15   when: grub_setup | bool
16   tags: "online"
17   ignore_errors: "{{ignore_online_errors | bool}}"
18
19
20 - name: setup grub-defaults
21   copy:
22     src: "{{item}}"
23     dest: "/etc/default/grub"
24   with_first_found:
25     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/grub"
26     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/grub"
27     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/grub"
28     - "default/grub"
29   when: grub_setup | bool
30   notify: update-grub
31
32
33 - name: setup grub protections
34   template:
35     src: "{{item}}"
36     dest: "/etc/grub.d/10_linux"
37     mode: 0755
38     owner: "root"
39     group: "root"
40   with_first_found:
41     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/10_linux.j2"
42     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/10_linux.j2"
43     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/10_linux.j2"
44     - "templates/10_linux.j2"
45   when: grub_setup | bool
46   notify: update-grub