In this repo, I want to explore some of the basic Ansible features that allow you to manage your VMs.
kcli create plan -f docs/kcli-template-rhel92.yaml rhel92 # Create a basic plan with one VM
kcli plan -s rhel92 # Start the plan
kcli plan -w rhel92 # Stop the plan
kcli list vm # Show VMs status
kcli plan -d rhel92 # Delete the plan
sudo bash -c 'echo "192.168.122.100 rhel92.vm" >> /etc/hosts'
ssh-copy-id rhel92.vm
# List available images
ansible-navigator images
# List available modules
ansible-navigator doc -l
# List available collections
ansible-navigator collections
# Get documentation for one module
ansible-navigator -s doc module_name
# Create a role from scratch
ansible-galaxy init alvaro.testing
ansible-navigator config init --disabled > ansible.cfg
ansible-navigator settings --sample > ansible-navigator.yml
# Create secret
ansible-vault create --vault-password-file=vault-pass.txt group_vars/web/vault.yml
# Edit Secret
ansible-vault edit --vault-password-file=vault-pass.txt group_vars/web/vault.yml
# Execute Plays with password
ansible-navigator run -m stdout --vault-password-file=vault-pass.txt plays/20_variables.yaml
ansible-navigator run -m stdout --ask-become-pass plays/40_task_control.yaml
# Install a Role
ansible-galaxy role install -r roles/requirements.yml
# Install a Collection
ansible-galaxy collection install -r collections/requirements.yml -p collections
KCS about System Roles availability and support: https://access.redhat.com/articles/3050101
ansible-navigator run -m stdout --ask-become-pass plays/70_roles_and_collections.yaml
ansible-navigator run -m stdout --ask-become-pass plays/90_rh_subs.yaml
๐ก
|
I strongly recommend the exercises proposed by mateuszstompor in his repo rhce-ex294-exam. He has some generic exercises that provide a good starting point to make sure that you control the topics that appear in the RHCE exam for RHEL 9. |