Giter Club home page Giter Club logo

ansible-role-grub's Introduction

Ansible Role: grub

An Ansible Role that configure grub on RHEL/CentOS, Fedora and Debian/Ubuntu.

Requirements

Operating system running on bare metal or on a hypervisor virtualization. Grub does not work on conteinerized systems.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

grub_default_path: /etc/default/grub

Full path of default grub settings.

grub_timeout: 5

Grub menu timeout in seconds.

grub_recordfail_timeout: "{{ grub_timeout }}"

Menu timeout if "recordfail" condition is true.

grub_allow_reboot: no

Should role perform a reboot after setting up grub?

#grub_options_present:
#  - cgroup_enable=memory
#  - quiet
#  - some.option=complex,off

Options to be added to GRUB_CMDLINE_LINUX. Value is optional.

#grub_options_absent:
#  - splash
#  - rd.driver.pre

Options to be removed from GRUB_CMDLINE_LINUX. Notice that only the key should be listed. For example, to remove audit=0, just add audit to the list. Use grub_options_present to ensure the proper value is present. Note that if the options to be added won´t be deleted because the key is listed in this variable.

#grub_superuser: myuser
#grub_password: grub.pbkdf2.sha512.10000.65AA561A865A2CA878473E9080A65E9F0614AEB11BE9BC08DA8E48FF51A4B285B68C299908E75256C992104265C6C9A46A418C889FC5975DD183C501B4998BEA.E050D8AE711A6424E48A946D95C7D10C12A56BE1270939455D676ED7B07FA0307371EF835FB1C8E4B3EF78A78E62AE1F582908355296259C744DDE7E78D5AB19

Sets grub user and password.

#grub_boot_path: /boot/grub2

Optional variable. The role will check if /boot/grub or /boot/grub2 are present in the target system IF this variable is not defined.

#grub_cfg_path: /boot/grub2/grub.cfg

Optional variable. The role will check if it is located at grub_boot_path or at /boot/efi/EFI... if EFI is enabled on the system. Checking will happen only IF this variable is not defined.

The variables listed below do not need to be changed for targeted systems (see vars/main.yml):

grub_packages:

Packages that need to be installed to provide grub functionality.

grub_update_grub_command:

Command to be used to issue grub update.

grub_cmdline_var_name:

Represents the cmdline variable that needs to be changed in order to add or remove kernel options.

grub_d_path:

Grub configuration directory.

Dependencies

No dependencies.

Example Playbook

- hosts: servers
  vars:
    grub_timeout: 5
    grub_recordfail_timeout: "{{ grub_timeout }}"
    grub_options_present:
      - cgroup_enable=memory
      - quiet
      - some.option=complex,off
    grub_options_absent:
      - splash
      - rd.driver.pre
    grub_superuser: testuser
    grub_password: grub.pbkdf2.sha512.10000.65AA561A865A2CA878473E9080A65E9F0614AEB11BE9BC08DA8E48FF51A4B285B68C299908E75256C992104265C6C9A46A418C889FC5975DD183C501B4998BEA.E050D8AE711A6424E48A946D95C7D10C12A56BE1270939455D676ED7B07FA0307371EF835FB1C8E4B3EF78A78E62AE1F582908355296259C744DDE7E78D5AB19 
  roles:
     - { guidugli.grub }

License

MIT / BSD

Author Information

This role was created in 2020 by Carlos Guidugli.

ansible-role-grub's People

Contributors

guidugli avatar

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.