Vagrantfile with buildout configuration for a Virtualbox VM with RHEL 8 server-desktop and configuration for building out an ansible workshop within AWS
- VirtualBox & Extension Pack
- Vagrant
- vagrant-vbguest
vagrant plugin install vagrant-vbguest
- To register with subscription-manager a free RedHat Developer subscription is required. This Vagrantfile expects to find the credentials in environment variables called
RH_SUBSCRIPTION_MANAGER_USER
andRH_SUBSCRIPTION_MANAGER_PW
. Ensure these are exported and available to Vagrant, the Vagrantfile will abort if these are not set. - group_var/all.yml file filled in with all your specific settings an example is available here
Be sure to update the source_all variable in Vagrantfile of where your all.yml file is located on host system. To start the vm just run command
vagrant up
Vagrantfile to spin up a RHEL 8 VM and register with RHN via subscription-manager. It will install the environment for running ansible playbooks to build the red hat ansible workshop on AWS.
ansible-playbook 1_provision.yml
NOTE: If 1_provision.yml playbook has errors you will need to start over after running
ansible-playbook 3_unregister.yml -e NOSSH=true
ansible-playbook 2_load.yml
NOTE: Playbook 2_load.yml will hang twice while doing the subscription manager tasks. After each time it hangs just run the playbook again.
copy the test-workshop.yml file onto the admin server and run
ansible nodes -m shell -a 'rpm -qa | grep docker'
ansible nodes -m shell -a 'rpm -qa | grep podman'
ansible nodes -m shell -a 'docker images redhatgov/alpine' -b
ansible nodes -m shell -a 'docker images redhatgov/fedora' -b
ansible nodes -m shell -a 'podman images redhatgov/alpine' -b
ansible nodes -m shell -a 'podman images redhatgov/fedora' -b
ansible-playbook 3_unregister.yml
NOTE: If any errors while unregistering run again with environment variable
ansible-playbook 3_unregister.yml -e NOSSH=true
Using the current latest versions of Vagrant and VirtualBox on MacOS, the version of VirtualBox Guest Additions is newer than the version packaged in roboxes/rhel8. Vagrant will try and update this before the VM has been registered with RHN so all calls to yum install fail. For this reason config.vbguest.auto_update = false
is configured.