Mirror of github.com/nicolabs/ansible-role-grub
Go to file
2020-12-04 14:17:40 +01:00
.github Update molecule action to use newer version of Ansible and Molecule. 2020-12-03 17:04:53 +01:00
defaults
handlers Empty line to start and dont restart when in checkmode, software is missing. 2020-11-24 20:50:17 +01:00
meta Test on Fedora 33! 2020-10-27 21:37:42 +01:00
molecule/default Add ansible-lint to the linting stage. 2020-09-22 10:24:49 +02:00
tasks Test is a defined variable is a string. 2020-11-27 16:32:17 +01:00
vars
.ansible-lint Exclude .tox 2020-09-01 15:15:07 +02:00
.gitignore
.gitlab-ci.yml Add GitLab CI! 2020-12-04 14:17:40 +01:00
.pre-commit-config.yaml Pre-commit, preventing me from making silly mistakes. 2020-11-19 20:10:58 +01:00
.travis.yml Much simpler, save build-minutes. 2020-12-04 14:17:35 +01:00
.yamllint Exclude .tox 2020-09-01 15:15:07 +02:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md List requirements with their build status. 2020-11-06 08:35:09 +01:00
requirements.yml New format for requirements, prepared for collections. 2020-11-01 20:18:15 +01:00
SECURITY.md
tox.ini Fedora 33 (running the tests) has python 3.9 and require higher version of tox. 2020-12-03 17:04:50 +01:00

grub

Configure grub on your system.

Travis GitHub Quality Downloads Version
travis github quality downloads Version

Example Playbook

This example is taken from molecule/resources/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - role: robertdebock.grub
      grub_options:
        - option: cgroup_enable
          value: memory
        - option: systemd.unified_cgroup_hierarchy
          value: 0

The machine needs to be prepared in CI this is done using molecule/resources/prepare.yml:

---
- name: prepare
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: robertdebock.bootstrap

  tasks:
    - name: make /etc/default
      file:
        path: /etc/default
        state: directory
        mode: "0755"
    - name: place bogus /etc/default/grub
      copy:
        content: 'GRUB_CMDLINE_LINUX="a=1"'
        dest: /etc/default/grub
        mode: "0664"

Also see a full explanation and example on how to use these roles.

Role Variables

These variables are set in defaults/main.yml:

---
# defaults file for grub

grub_timeout: 5

grub_recordfail_timeout: "{{ grub_timeout }}"

# Add options here, for example:
# grub_options:
#   - option: cgroup_enable
#     value: memory

Requirements

  • Access to a repository containing packages, likely on the internet.
  • A recent version of Ansible. (Tests run on the current, previous and next release of Ansible.)

Status of requirements

Requirement Travis GitHub
robertdebock.bootstrap Build Status Travis Build Status GitHub

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles: dependencies

Compatibility

This role has been tested on these container images:

container tags
alpine all
el 7, 8
debian buster, bullseye
fedora all
opensuse all
ubuntu focal, bionic, xenial

The minimum version of Ansible required is 2.9, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

Testing

Unit tests are done on every commit, pull request, release and periodically.

If you find issues, please register them in GitHub

Testing is done using Tox and Molecule:

Tox tests multiple ansible versions. Molecule tests multiple distributions.

To test using the defaults (any installed ansible version, namespace: robertdebock, image: fedora, tag: latest):

molecule test

# Or select a specific image:
image=ubuntu molecule test
# Or select a specific image and a specific tag:
image="debian" tag="stable" tox

Or you can test multiple versions of Ansible, and select images: Tox allows multiple versions of Ansible to be tested. To run the default (namespace: robertdebock, image: fedora, tag: latest) tests:

tox

# To run CentOS (namespace: `robertdebock`, tag: `latest`)
image="centos" tox
# Or customize more:
image="debian" tag="stable" tox

License

Apache-2.0

Author Information

Robert de Bock

Please consider sponsoring me.