Setup and Configure SNMP
- Copy
.env.example
as.env
- Add/Update environment variables as needed
source .env
to load variables into the current session
Update Vagrantfile.yml to configure the VMs that will be created.
# bring the VM up
vagrant up
# connect via ssh
vagrant ssh vagrant01
# stop the vm
vagrant halt
# delete the vm
vagrant destroy
Download the role and collection dependencies:
cd roles
ansible-galaxy role install -r requirements.yml
ansible-galaxy collection install -r requirements.yml
# if you want to install locally
# ansible-galaxy role install --roles-path . -r requirements.yml
ansible vagrant -a "date"
To execute the playbook to configure the VM execute the following:
# run the playbook against a specific vm
ansible-playbook playbook.yml # --limit vagrant01
production # inventory file for production servers
staging # inventory file for staging environment
group_vars/
group1.yml # here we assign variables to particular groups
group2.yml
host_vars/
hostname1.yml # here we assign variables to particular systems
hostname2.yml
library/ # if any custom modules, put them here (optional)
module_utils/ # if any custom module_utils to support modules, put them here (optional)
filter_plugins/ # if any custom filter plugins, put them here (optional)
site.yml # main playbook
webservers.yml # playbook for webserver tier
dbservers.yml # playbook for dbserver tier
tasks/ # task files included from playbooks
webservers-extra.yml # <-- avoids confusing playbook with task files
- https://github.com/sbaerlocher/ansible.snmp
- https://access.redhat.com/solutions/17815
- https://access.redhat.com/solutions/341073
- https://access.redhat.com/solutions/30119
- https://access.redhat.com/solutions/1130063
- https://access.redhat.com/solutions/3848721
- https://access.redhat.com/solutions/273513
- https://www.ansible.com/blog/announcing-the-red-hat-enterprise-linux-certified-ansible-collection
- https://galaxy.ansible.com/ui/repo/published/fedora/linux_system_roles/
- https://github.com/linux-system-roles/
- Ansible User Guide
- Introduction to Ansible for Linux System Roles
- linux-system-roles
- Vagrant Advanced Examples
- Ansible tips and tricks | Sample Ansible setup | Sample directory layout
- Red Hat Enterprise Linux (RHEL) System Roles
- Ways to check for open ports on RHEL