Giter VIP home page Giter VIP logo

ansible-role-grub's Introduction

ROLE GRUB

image

image

image

A brief description of the role goes here.

Requirements

Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.

Role Variables

start grub and linux on these consoles

grub serial command settings

grub timeout (in seconds)

disable predictable network interface names

additional cmdline arguments type: list

additional cmdline default arguemnts type: list

An example how to add additional parameters to the kernel:

Dependencies

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

License

GPL-3.0

Author Information

grub role was written by:

ansible-role-grub's People

Contributors

eni23 avatar eyenx avatar fujexo avatar karras avatar keachi avatar kevinkrall avatar shurik-io avatar tongpu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-grub's Issues

Implement EFI support

Currently we only support legacy BIOS or UEFI systems in CSM mode. However the older UEFI gets, the lesser amount of systems (maybe except VMs) will support CSM mode or already show more issues in CSM mode (already happened to me) instead of native UEFI.

We should accomodate for the future and therefore fix our role to detect UEFI and configure grub accordingly.

Facts to differentiate BIOS vs. UEFI mode
There doesn't seem to be many native facts we can use to identify a UEFI system, so far:

  • If a partition exists mounted with mount point /boot/efi
  • If said partition has fstype vfat
  • If i.e. the following packags are present
    • EL6 (grub1): Apparently only efibootmgr
    • EL7 (grub2): efibootmgr, efivar-libs, grub2-efi

What is different
At least on EL6 (confirmed manually) and EL7 (confirmed) the variable grub_boot_cfg needs to be /boot/grub2/grub.cfg instead of /boot/grub2/grub.cfg. However the role explicitely only supports EL7 which brings leads us to the need to accomodate for 3 known variantes based on the supported EL distributions of this module:

  • legacy CSM: /boot/grub2/grub.cfg (same for RHEL and CentOS)
  • UEFI on RHEL: /boot/efi/EFI/redhat/grub.cfg
  • UEFI CentOS: /boot/efi/EFI/centos/grub.cfg

Vendor documentation
Documentation from Red Hat: Red Hat Enterprise Linux 7, Migration Planning Guide 2.2. Installation and Boot

Change Default of disable_predictable_interface_names to "False"

Problem

Starting with Debian 10 this setting:
https://github.com/adfinis-sygroup/ansible-role-grub/blob/1a706cac86f77fb5990f70e386bc9d95d3278a0d/defaults/main.yml#L20
is not supported anymore and needs to be removed before upgrading from Debian 9(stretch) to 10 (buster). See here: https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#migrate-interface-names

In EL Distributions, it is the default since major version 7.

Result

As a consequence of this unsupported setting, if this role is applied to Debian 10 installations, the network connectivity can be lost after reboot. (I didn't test it)

Suggestion

So I suggest to change this default to grub_disable_network_predictable_interface_names: False

For backwards compatibility, we should set the old default on Debian <=9 to "True". Because there are still a lot of EL 7 installations running out there with this setting, I guess we can more safely introduce this setting starting with EL = 8.

Please add your feedback, if this change of this settings makes sense and if so, what needs to be done to roll it out safely.

role fails when grub_consoles is empty

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible 2.9.6
  config file = /home/tedgin/.ansible.cfg
  configured module search path = ['/home/tedgin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
CONFIGURATION

DEFAULT_FORKS(/home/tedgin/.ansible.cfg) = 10
DEFAULT_TIMEOUT(/home/tedgin/.ansible.cfg) = 20
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/tedgin/.ansible_vault_pass.txt
INTERPRETER_PYTHON(/home/tedgin/.ansible.cfg) = /usr/bin/python3
RETRY_FILES_ENABLED(/home/tedgin/.ansible.cfg) = False

OS / ENVIRONMENT

The ansible control node is running CentOS 7.
The managed node is running Ubuntu 20.04.

SUMMARY

When there are no consoles for grub, the role fails complaining grub_console isn't defined.

STEPS TO REPRODUCE

Set the role variable grub_consoles to [] in the playbook, and run it

---
- name: Prepare for PostgreSQL
  hosts: dbms
  become: true
  roles:
     - role: adfinis_sygroup.grub
       grub_consoles: []
EXPECTED RESULTS

I expect it to update /etc/default/grub.

ACTUAL RESULTS

It fails to errors out before updating /etc/default/grub.

BECOME password: 

PLAY [Prepare for PostgreSQL] **********************************************************************

TASK [Gathering Facts] *****************************************************************************
ok: [qairods.cyverse.org]

TASK [adfinis_sygroup.grub : include os specific vars] *********************************************
ok: [qairods.cyverse.org] => (item=/home/tedgin/repos/ds/deployments/qa/playbooks/dbms/roles/adfinis_sygroup.grub/vars/Debian.yml)

TASK [adfinis_sygroup.grub : install grub related packages] ****************************************
ok: [qairods.cyverse.org]

TASK [adfinis_sygroup.grub : remove unused grub packages] ******************************************
ok: [qairods.cyverse.org]

TASK [adfinis_sygroup.grub : create the grub configuration] ****************************************
fatal: [qairods.cyverse.org]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'grub_console' is undefined"}

PLAY RECAP *****************************************************************************************
qairods.cyverse.org        : ok=4    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.