Giter Club home page Giter Club logo

ansible-role_custom-rhel-iso's Introduction

Ansible role: create RHEL custom iso file

This role has been tested with three different versions of RHEL, this is 8.5, 8.6 and 9. You need to download the original iso file from Red Hat and store it in your target host, remember to define all the mandatory variables, including the full path to the original Red Hat iso file.

You only need to give values to all of the variables (some of these are optional):

#Directories and files
my_original_iso_full_path: /ISO-files/rhel-8.5-x86_64-dvd.iso
my_custom_iso: /ISO-files/my_custom.iso
my_working_dir: /tmp/working-dir
my_mnt_dir: /tmp/mnt-dir

#General iso configuration
my_system_language: en_US
my_keyboard_layout: es
my_time_zone: Europe/Paris
my_root_pass: redhat

#Networking options for iso file
my_network_bootprotocol: dhcp #Mandatory variable, options are "dhcp" or "static"
my_hostname: testhostname #Optional
my_netdevice: eht1 #Optional, only to be used if my_network_bootprotocol is "static"
my_ip: 192.168.1.23 #Mandatory when my_network_bootprotocol is "static"
my_netmask: 24 #Optional, only to be used if my_network_bootprotocol is "static"
my_gateway: 4.5.6.7 #Optional, only to be used if my_network_bootprotocol is "static"
my_dns_server: 8.8.8.8 #Optional, only to be used if my_network_bootprotocol is "static"

#Optional Red Hat CDN user and password for registering with Insights
my_rhn_user: myuser
my_rhn_pass: mypassword

#Optional, users to be created. You can add as many users as you want by growing the dictionary with the same structure
#Every entry on the dictionary must have "name" and "password" fields, optionally you can define additional groups for the user with the "groups" field (see example below)
my_users:
  - name: ansible
    password: redhat
    groups: wheel
  - name: preciado
    password: redhat
    groups: wheel
  - name: pablo
    password: redhat

Once you know all the values for your variables just write a simple playbook calling the role and defining the variables, such as the one you can find in the "example.yml" file.

---
- name: Example playbook for generating new custom iso
  hosts: target1
  become: true
  
  vars:
    #Directories and files
    my_original_iso_full_path: /ISO-files/rhel-8.5-x86_64-dvd.iso
    my_custom_iso: /ISO-files/my_custom.iso
    my_working_dir: /tmp/working-dir
    my_mnt_dir: /tmp/mnt-dir
    
    #General iso configuration
    my_system_language: en_US
    my_keyboard_layout: es
    my_time_zone: Europe/Paris
    my_root_pass: redhat
    
    #Networking options for iso file
    my_network_bootprotocol: dhcp #Mandatory variable, options are "dhcp" or "static"
    my_hostname: testhostname #Optional
    my_netdevice: eht1 #Optional, only to be used if my_network_bootprotocol is "static"
    my_ip: 192.168.1.23 #Mandatory when my_network_bootprotocol is "static"
    my_netmask: 24 #Optional, only to be used if my_network_bootprotocol is "static"
    my_gateway: 4.5.6.7 #Optional, only to be used if my_network_bootprotocol is "static"
    my_dns_server: 8.8.8.8 #Optional, only to be used if my_network_bootprotocol is "static"
    
    #Optional Red Hat CDN user and password for registering with Insights
    my_rhn_user: myuser
    my_rhn_pass: mypassword
    
    #Optional, users to be created. You can add as many users as you want by growing the dictionary with the same structure
    #Every entry on the dictionary must have "name" and "password" fields, optionally you can define additional groups for the user with the "groups" field (see example below)
    my_users:
      - name: ansible
        password: redhat
        groups: wheel
      - name: preciado
        password: redhat
        groups: wheel
      - name: pablo
        password: redhat
  
  roles:
     - custom-iso-role

Then run the ansible-navigator command for executing your playbook:

ansible-navigator run example.yml -m stdout

References:

Red Hat kickstart generator

How to create a modified Red Hat Enterprise Linux ISO with kickstart file or modified installation media?

ansible-role_custom-rhel-iso's People

Contributors

pablo-preciado 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.