generated from linux-system-roles/template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bootloader_facts.py Add bootloader_settings module to configure settings instead of tasks Add unit tests for bootloader_settings and bootloader_facts
- Loading branch information
Showing
23 changed files
with
1,150 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
# Here is the right place to put the role's input variables. | ||
# This file also serves as a documentation for such a variables. | ||
bootloader_settings: [] | ||
bootloader_timeout: 5 | ||
|
||
# Examples of role input variables: | ||
bootloader_foo: "foo" | ||
bootloader_bar: "bar" | ||
bootloader_password: null | ||
bootloader_remove_password: false | ||
|
||
bootloader_reboot_ok: false | ||
|
||
bootloader_gather_facts: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
# Put handlers for tasks here. | ||
# EL 7 workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1152027 | ||
- name: Fix default kernel boot parameters | ||
shell: |- | ||
set -o pipefail | ||
grubby --info=DEFAULT | awk '/^args/ {print $0}' | ||
cat {{ __bootloader_default_grub }} | ||
eval $(grubby --info=DEFAULT | awk '/^args/ {print $0}') | ||
sed -i -e "s|^GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX=\"$args\"|" \ | ||
{{ __bootloader_default_grub }} | ||
cat {{ __bootloader_default_grub }} | ||
changed_when: true | ||
when: >- | ||
(ansible_distribution in ['CentOS', 'RedHat'] and | ||
ansible_facts.distribution_major_version is version('7', '=')) or | ||
ansible_distribution == 'Fedora' | ||
# Example: | ||
- name: Bootloader handler to restart services | ||
service: | ||
name: "{{ item }}" | ||
state: restarted | ||
loop: "{{ __bootloader_services }}" | ||
- name: Rebuild grub config | ||
command: grub2-mkconfig -o {{ __bootloader_grub_conf }} | ||
changed_when: true | ||
|
||
- name: Reboot system | ||
include_tasks: tasks/reboot.yml |
Oops, something went wrong.