Skip to content

Instantly share code, notes, and snippets.

View chornberger-c2c's full-sized avatar

Christopher Hornberger chornberger-c2c

View GitHub Profile
@chornberger-c2c
chornberger-c2c / requirements.yml
Created October 9, 2024 13:41
Ansible community.general requirements
collections:
# Install a collection from Ansible Galaxy.
- name: community.general
source: https://galaxy.ansible.com
@chornberger-c2c
chornberger-c2c / adjoin.yml
Created October 9, 2024 10:39
adjoin.yml
---
- hosts: all
become: true
vars:
- addomain: "mydomain"
- user: "myuser"
vars_prompt:
- name: password
@chornberger-c2c
chornberger-c2c / rh-satellite-errata.yml
Last active December 22, 2023 09:23
Red Hat Satellite - Errata and Packages
---
- hosts: all
vars:
satellite_fqdn: satellite.local
satellite_port: 443
satellite_user: admin
satellite_password: changeme
@chornberger-c2c
chornberger-c2c / sat6CreateHost.sh
Last active March 18, 2025 14:20
Create a host on Red Hat Satellite
#!/bin/bash
usage() {
cat <<EOF
Creates a host on a Satellite server
Usage: $0
-g, --hostgroup hostgroup ID
-h, --host host to create
@chornberger-c2c
chornberger-c2c / register-to-satellite.yml
Last active July 11, 2023 06:50
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
@chornberger-c2c
chornberger-c2c / migrate_awx_to_aap2.yml
Last active July 4, 2023 16:34
Migrate from one Ansible Controller (eg. AWX) to another (eg. Red Hat AAP2)
---
- name: Export assets from one Ansible Controller (eg. AWX) and import to another one (eg. AAP2)
hosts: localhost
vars:
source_controller_host: "https://source-awx.example.com"
source_controller_user: "admin"
source_controller_password: "password"
target_controller_host: "https://target-aap2.example.com"
target_controller_user: "admin"
@chornberger-c2c
chornberger-c2c / check_content_view_synchronization.yml
Last active July 4, 2023 14:27
Check if Content View is up to date on Capsule
---
- name: Check if Content View is up to date on Capsule
hosts: localhost
tasks:
- name: Retrieve values from Satellite
ansible.builtin.uri:
url: "https://{{ satellite_fqdn }}/katello/api/capsules/{{ capsule_id }}/content/sync"
method: GET
url_username: "{{ satellite_user }}"
@chornberger-c2c
chornberger-c2c / vm_ubuntu_2204.xml
Created June 14, 2023 17:17
Disable seclabels for SELinux on libvirtd
<seclabel type='none' model='selinux'/>
@chornberger-c2c
chornberger-c2c / Vagrantfile
Created June 14, 2023 17:06
Vagrantfile with custom libvirt storage pool
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu2204"
config.vm.provider :libvirt do |v|
v.storage_pool_name = "libvirt-home"
v.memory = "4096"
v.cpus = "4"
end
end
@chornberger-c2c
chornberger-c2c / log4j.yml
Created May 12, 2023 09:26
Ansible playbook for log4j
---
- hosts: all
vars:
responsible_class: JndiLookup.class
tasks:
- name: Check if filename has been provided
ansible.builtin.fail: