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.
- Loading branch information
Showing
12 changed files
with
125 additions
and
80 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
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,17 +1,23 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
- name: Write boot loader configuration | ||
command: grub2-mkconfig -o {{ __bootloader_grub_conf }} | ||
changed_when: true | ||
|
||
# A workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1152027 | ||
- name: Fix default kernel boot parameters on EL 7 | ||
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 }} | ||
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'] | ||
- ansible_facts.distribution_major_version is version('7', '=') | ||
|
||
# - name: Write boot loader configuration | ||
# command: grub2-mkconfig -o {{ __bootloader_grub_conf }} | ||
# changed_when: true | ||
# when: | ||
# - ansible_distribution in ['CentOS', 'RedHat'] | ||
# - ansible_facts.distribution_major_version is version('7', '=') |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
- name: Test bootloader_settings variable | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Set boot loader password | ||
vars: | ||
bootloader_password: dummy-pass | ||
include_role: | ||
name: linux-system-roles.bootloader | ||
|
||
- name: Get contents of {{ __bootloader_user_conf }} | ||
command: cat {{ __bootloader_user_conf }} | ||
failed_when: >- | ||
not (__bootloader_user_conf_content.stdout | | ||
regex_search('^GRUB2_PASSWORD=grub\.pbkdf2\.sha512\.10000\..*')) | ||
register: __bootloader_user_conf_content | ||
changed_when: false | ||
|
||
- name: Remove boot loader password | ||
vars: | ||
bootloader_remove_password: true | ||
include_role: | ||
name: linux-system-roles.bootloader | ||
|
||
- name: Get stat of {{ __bootloader_user_conf }} | ||
stat: | ||
path: "{{ __bootloader_user_conf }}" | ||
register: __bootloader_user_conf_stat | ||
|
||
- name: Verify that user conf doesn't exist | ||
assert: | ||
that: not __bootloader_user_conf_stat.stat.exists |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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