diff --git a/README.md b/README.md index a208916..63bd1d6 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ While the code works, this README is a work in progress. Full instructions will ## Lab Environment -My test Lab is libvirt on Fedora 38. I created a subnet 192.168.100.0/24 with DHCP disabled, and NAT forwarding. The Gateway is 192.168.100.1, and the Satellite is 192.168.100.2. For the Red Hat Satellite installation, the DHCP pool is the 192.168.100.100 - 150. I deployed the Red Hat Satellite and subsequent clients into the test.org domain. I started with a Minimal install of RHEL 8.8, registered to Red Hat Subscription Management on the Internet. My Red Hat Satellite VM is 4 CPU x 20GB RAM with a single 150GB disk. Given Red Hat Satellite can take up quite a bit of storage, I went with the following partition layout: +My test Lab is libvirt on Fedora 38. I created a subnet 192.168.100.0/24 with DHCP disabled, and NAT forwarding. The Gateway is 192.168.100.1, and the Satellite is 192.168.100.2. For the Red Hat Satellite installation, the DHCP pool is the 192.168.100.100 - 150. I deployed the Red Hat Satellite and subsequent clients into the test.org domain. I started with a Minimal install of RHEL 8.9, registered to Red Hat Subscription Management on the Internet. My Red Hat Satellite VM is 4 CPU x 20GB RAM with a single 150GB disk. Given Red Hat Satellite can take up quite a bit of storage, I went with the following partition layout: - /boot 1 GB ext4 - / 139.14 GB ext4 @@ -33,7 +33,7 @@ To use this code, you need to customize the variable files for your needs. The │   ├── main.yml (set your organization) │   └── vault.yml (There are several variables to set according to your needs) ├── host_vars - │   └── sattest.test.org.yml (Your subscription pool id for your manifest, and satellite installer options) + │   └── sattest.test.org.yml (Your list of subscription pool ids and quantities for your manifest, and satellite installer options) ├── inventory.yml (Your satellite FQDN must be in the satellites group, adjust the host_vars filename to match as well) ├── secret (This file contains your secret to decrypt your ansible vault in plain text) └── vars ( all of these files can be used as is, to setup a Standard Operating Environment Red Hat Satellite, but may be customized) diff --git a/configure_satellite.yml b/configure_satellite.yml index 34b2527..25c58f0 100644 --- a/configure_satellite.yml +++ b/configure_satellite.yml @@ -9,5 +9,8 @@ - name: Maintain Activation Keys import_playbook: maintain_activation_keys.yml +- name: Maintain Locations + import_playbook: maintain_locations.yml + - name: Maintain Satellite Provisioning Configuration import_playbook: maintain_provisioning.yml diff --git a/host_vars/sattest.test.org.yml b/host_vars/sattest.test.org.yml index 2a19a0e..74f3d13 100644 --- a/host_vars/sattest.test.org.yml +++ b/host_vars/sattest.test.org.yml @@ -15,7 +15,14 @@ firewall: - service: tftp state: enabled -subscription_pool_id: +subscription_pools: + ### To find subscriptions, use subscription-manager command on Satellite to search for the necessary product + ### Manifest will need Sat Infra, RHEL Premium, ELS subscriptions + ### the ansible module does not like virtual subs so just use physical + ### + ### subscription-manager list --all --available --matches 'Red Hat Satellite Infrastructure Subscription' + - id: + quantity: satellite_installer_scenario: satellite satellite_installer_options: @@ -37,4 +44,5 @@ satellite_installer_options: - '--foreman-proxy-tftp-servername {{ inventory_hostname }}' - '--foreman-proxy-http true' - '--foreman-proxy-templates true' + - '--foreman-proxy-registration true' - '--register-with-insights' diff --git a/install_satellite.yml b/install_satellite.yml index baac4bd..fb24798 100644 --- a/install_satellite.yml +++ b/install_satellite.yml @@ -32,14 +32,15 @@ username: "{{ red_hat_portal_username }}" password: "{{ red_hat_portal_password }}" content_access_mode: org_environment - pool_id: "{{ subscription_pool_id }}" - quantity: 10 + pool_id: "{{ item.id }}" + quantity: "{{ item.quantity }}" path: "/root/{{ inventory_hostname }}_manifest.zip" + loop: "{{ subscription_pools }}" register: manifest - name: Store Manifest UUID ansible.builtin.copy: - content: "{{ manifest.uuid }}" + content: "{{ manifest.results[0].uuid }}" dest: "/root/{{ inventory_hostname }}_manifest_uuid.txt" mode: '0640' diff --git a/maintain_locations.yml b/maintain_locations.yml new file mode 100644 index 0000000..4b12a4d --- /dev/null +++ b/maintain_locations.yml @@ -0,0 +1,13 @@ +--- +- name: Maintain Locations + hosts: satellites + gather_facts: false + vars_files: + - vars/locations.yml + + roles: + - role: redhat.satellite.locations + vars: + satellite_server_url: "https://{{ inventory_hostname }}" + satellite_locations: "{{ locations }}" + tags: locations diff --git a/sat_prep.bash b/sat_prep.bash index f318969..0e8d6dc 100755 --- a/sat_prep.bash +++ b/sat_prep.bash @@ -2,13 +2,13 @@ cd /root -# Configure Satellite 6.13 repositories +# Configure Satellite 6.14 repositories subscription-manager repos --disable "*" subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms \ --enable=rhel-8-for-x86_64-appstream-rpms \ ---enable=satellite-6.13-for-rhel-8-x86_64-rpms \ ---enable=satellite-maintenance-6.13-for-rhel-8-x86_64-rpms +--enable=satellite-6.14-for-rhel-8-x86_64-rpms \ +--enable=satellite-maintenance-6.14-for-rhel-8-x86_64-rpms dnf -y module enable satellite:el8 diff --git a/satellite_complete_installation_configuration.yml b/satellite_complete_installation_configuration.yml index 48be92d..5f0e594 100644 --- a/satellite_complete_installation_configuration.yml +++ b/satellite_complete_installation_configuration.yml @@ -12,9 +12,11 @@ - name: Maintain Activation Keys import_playbook: maintain_activation_keys.yml +- name: Maintain Locations + import_playbook: maintain_locations.yml + - name: Maintain Satellite Provisioning Configuration import_playbook: maintain_provisioning.yml - name: Set Default Root Password for Hostgroups import_playbook: hostgroup_set_default_root_password.yml - \ No newline at end of file diff --git a/vars/actkeys.yml b/vars/actkeys.yml index 735cda6..9d157ca 100644 --- a/vars/actkeys.yml +++ b/vars/actkeys.yml @@ -145,7 +145,7 @@ activation_keys: override: disabled - label: rhel-9-for-x86_64-baseos-rpms override: disabled - - label: satellite-capsule-6.13-for-rhel-8-x86_64-rpms + - label: satellite-capsule-6.14-for-rhel-8-x86_64-rpms override: enabled - - label: satellite-maintenance-6.13-for-rhel-8-x86_64-rpms + - label: satellite-maintenance-6.14-for-rhel-8-x86_64-rpms override: enabled diff --git a/vars/content_views.yml b/vars/content_views.yml index 7040394..6490d83 100644 --- a/vars/content_views.yml +++ b/vars/content_views.yml @@ -62,11 +62,11 @@ content_views: product: "EPEL 8" - name: "Red Hat CodeReady Linux Builder for RHEL 8 x86_64 RPMs 8" product: "Red Hat CodeReady Linux Builder for x86_64" - - name: "Red Hat Enterprise Linux 8 for x86_64 - AppStream Kickstart 8.8" + - name: "Red Hat Enterprise Linux 8 for x86_64 - AppStream Kickstart 8.9" product: "Red Hat Enterprise Linux for x86_64" - name: "Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8" product: "Red Hat Enterprise Linux for x86_64" - - name: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.8" + - name: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.9" product: "Red Hat Enterprise Linux for x86_64" - name: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs 8" product: "Red Hat Enterprise Linux for x86_64" @@ -87,11 +87,11 @@ content_views: product: "EPEL 9" - name: "Red Hat CodeReady Linux Builder for RHEL 9 x86_64 RPMs 9" product: "Red Hat CodeReady Linux Builder for x86_64" - - name: "Red Hat Enterprise Linux 9 for x86_64 - AppStream Kickstart 9.2" + - name: "Red Hat Enterprise Linux 9 for x86_64 - AppStream Kickstart 9.3" product: "Red Hat Enterprise Linux for x86_64" - name: "Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs 9" product: "Red Hat Enterprise Linux for x86_64" - - name: "Red Hat Enterprise Linux 9 for x86_64 - BaseOS Kickstart 9.2" + - name: "Red Hat Enterprise Linux 9 for x86_64 - BaseOS Kickstart 9.3" product: "Red Hat Enterprise Linux for x86_64" - name: "Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs 9" product: "Red Hat Enterprise Linux for x86_64" @@ -110,17 +110,17 @@ content_views: - Library - DEV8 repositories: - - name: "Red Hat Enterprise Linux 8 for x86_64 - AppStream Kickstart 8.8" + - name: "Red Hat Enterprise Linux 8 for x86_64 - AppStream Kickstart 8.9" product: "Red Hat Enterprise Linux for x86_64" - name: "Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8" product: "Red Hat Enterprise Linux for x86_64" - - name: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.8" + - name: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.9" product: "Red Hat Enterprise Linux for x86_64" - name: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs 8" product: "Red Hat Enterprise Linux for x86_64" - - name: "Red Hat Satellite Capsule 6.13 for RHEL 8 x86_64 RPMs" + - name: "Red Hat Satellite Capsule 6.14 for RHEL 8 x86_64 RPMs" product: "Red Hat Satellite Capsule" - - name: "Red Hat Satellite Maintenance 6.13 for RHEL 8 x86_64 RPMs" + - name: "Red Hat Satellite Maintenance 6.14 for RHEL 8 x86_64 RPMs" product: "Red Hat Enterprise Linux for x86_64" auto_publish: false solve_dependencies: false diff --git a/vars/hostgroups.yml b/vars/hostgroups.yml index ef7f8e8..8206e2e 100644 --- a/vars/hostgroups.yml +++ b/vars/hostgroups.yml @@ -75,8 +75,8 @@ hostgroups: domain: "test.org" subnet: "test.org" architecture: x86_64 - operatingsystem: "RHEL 8.8" - kickstart_repository: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.8" + operatingsystem: "RHEL 8.9" + kickstart_repository: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.9" ptable: "Kickstart default" pxe_loader: "PXELinux BIOS" ## Example of adding or overriding parameters @@ -106,8 +106,8 @@ hostgroups: domain: "test.org" subnet: "test.org" architecture: x86_64 - operatingsystem: "RedHat 9.2" - kickstart_repository: "Red Hat Enterprise Linux 9 for x86_64 - BaseOS Kickstart 9.2" + operatingsystem: "RedHat 9.3" + kickstart_repository: "Red Hat Enterprise Linux 9 for x86_64 - BaseOS Kickstart 9.3" ptable: "Kickstart default" pxe_loader: "PXELinux BIOS" ## Example of adding or overriding parameters @@ -137,8 +137,8 @@ hostgroups: domain: "test.org" subnet: "test.org" architecture: x86_64 - operatingsystem: "RHEL 8.8" - kickstart_repository: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.8" + operatingsystem: "RHEL 8.9" + kickstart_repository: "Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.9" ptable: "Kickstart default" pxe_loader: "PXELinux BIOS" ## Example of adding or overriding parameters diff --git a/vars/locations.yml b/vars/locations.yml new file mode 100644 index 0000000..c7e9d1c --- /dev/null +++ b/vars/locations.yml @@ -0,0 +1,5 @@ +--- +locations: + - name: "{{ satellite_location }}" + organizations: + - "{{ satellite_organization }}" diff --git a/vars/products.yml b/vars/products.yml index 0d813c7..05f8737 100644 --- a/vars/products.yml +++ b/vars/products.yml @@ -53,9 +53,9 @@ products: - name: Red Hat Enterprise Linux 8 for x86_64 - Supplementary (RPMs) releasever: 8 - name: Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart) - releasever: 8.8 + releasever: 8.9 - name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS (Kickstart) - releasever: 8.8 + releasever: 8.9 - name: Red Hat Satellite Client 6 for RHEL 8 x86_64 (RPMs) - name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) releasever: 9 @@ -64,12 +64,13 @@ products: - name: Red Hat Enterprise Linux 9 for x86_64 - Supplementary (RPMs) releasever: 9 - name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (Kickstart) - releasever: 9.2 + releasever: 9.3 - name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS (Kickstart) - releasever: 9.2 + releasever: 9.3 - name: Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs) ## Example of how to bring in the Red Hat Satellite Capsule repository - - name: Red Hat Satellite Maintenance 6.13 for RHEL 8 x86_64 (RPMs) + - name: Red Hat Satellite Maintenance 6.14 for RHEL 8 x86_64 (RPMs) + - name: Red Hat Satellite Utils 6.14 for RHEL 8 x86_64 (RPMs) - name: "Red Hat CodeReady Linux Builder for x86_64" repository_sets: - name: "Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)" @@ -84,7 +85,7 @@ products: ## Example of how to bring in the Red Hat Satellite Capsule repository # - name: Red Hat Satellite Capsule # repository_sets: - # - name: Red Hat Satellite Capsule 6.13 for RHEL 8 x86_64 (RPMs) + # - name: Red Hat Satellite Capsule 6.14 for RHEL 8 x86_64 (RPMs) # basearch: x86_64 ## RHEL 6 is no longer supported ## Example of how to bring in Developer Toolset repos @@ -155,8 +156,51 @@ products: # url: https://forge.puppetlabs.com - name: Red Hat Ansible Automation Platform repository_sets: + # - name: Red Hat Ansible Automation Platform 2.4 for RHEL 8 x86_64 (RPMs) - name: Red Hat Ansible Automation Platform 2.4 for RHEL 9 x86_64 (RPMs) ## Example of how to bring in the Red Hat Satellite Capsule repository - name: Red Hat Satellite Capsule repository_sets: - - name: Red Hat Satellite Capsule 6.13 for RHEL 8 x86_64 (RPMs) + - name: Red Hat Satellite Capsule 6.14 for RHEL 8 x86_64 (RPMs) + # - name: Red Hat Enterprise Linux Server - Extended Life Cycle Support + # repository_sets: + # - name: Red Hat Enterprise Linux 5 Server - Extended Life Cycle Support (RPMs) + # basearch: x86_64 + # # - name: Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support - Optional (RPMs) + # # basearch: i386 + # - name: Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support - Optional (RPMs) + # basearch: x86_64 + # # - name: Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support (RPMs) + # # basearch: i386 + # - name: Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support (RPMs) + # basearch: x86_64 + # - name: Red Hat Satellite Tools 6.8 (for RHEL 5 Server - ELS) (RPMs) + # basearch: x86_64 + # # - name: Red Hat Satellite Client 6 (for RHEL 6 Server - ELS) (RPMs) + # # basearch: i386 + # - name: Red Hat Satellite Client 6 (for RHEL 6 Server - ELS) (RPMs) + # basearch: x86_64 + # - name: Red Hat Enterprise Linux High Availability for x86_64 + # repository_sets: + # - name: Red Hat Enterprise Linux 8 for x86_64 - High Availability (RPMs) + # releasever: 8 + # - name: Red Hat Enterprise Linux 9 for x86_64 - High Availability (RPMs) + # releasever: 9 + # - name: Red Hat Enterprise Linux High Availability (for RHEL 6 Server) (RPMs) + # basearch: x86_64 + # releasever: 6Server + # - name: Red Hat Enterprise Linux High Availability (for RHEL 7 Server) (RPMs) + # basearch: x86_64 + # releasever: 7Server + # - name: Red Hat Enterprise Linux Resilient Storage for x86_64 + # repository_sets: + # - name: Red Hat Enterprise Linux Resilient Storage (for RHEL 6 Server) (RPMs) + # basearch: x86_64 + # releasever: 6Server + # - name: Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) (RPMs) + # basearch: x86_64 + # releasever: 7Server + # - name: Red Hat Enterprise Linux 8 for x86_64 - Resilient Storage (RPMs) + # releasever: 8 + # - name: Red Hat Enterprise Linux 9 for x86_64 - Resilient Storage (RPMs) + # releasever: 9