Skip to content

Instantly share code, notes, and snippets.

@chornberger-c2c
Last active July 11, 2023 06:50
Show Gist options
  • Save chornberger-c2c/eee5bd4136b80d1848fd5e73273aaaa5 to your computer and use it in GitHub Desktop.
Save chornberger-c2c/eee5bd4136b80d1848fd5e73273aaaa5 to your computer and use it in GitHub Desktop.
Ansible Lightspeed test: register a RHEL system to Satellite
---
- name: Register a host to satellite
hosts: all
vars:
satellite_url: https://satellite-6-6.local:8443
activationkey: RHEL-9
organization: camptocamp
tasks:
- name: Download the katello-ca-consumer-latest.rpm from satellite
ansible.builtin.get_url:
url: '{{ satellite_url }}/pub/katello-ca-consumer-latest.rpm'
dest: /tmp/katello-ca-consumer-latest.rpm
validate_certs: false
- name: Install the downloaded katello-ca-consumer-latest.rpm
ansible.builtin.yum:
name: /tmp/katello-ca-consumer-latest.rpm
- name: "Register a host to {{ satellite_url }}"
community.general.redhat_subscription:
state: present
activationkey: "{{ activationkey }}"
org_id: "{{ organization }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment