This Ansible playbook automates the process of enabling the Next Hop Resolution Protocol Daemon (NHRPD) on servers that have the Free Range Routing (FRR) package installed. The playbook checks for FRR installation, modifies the necessary configuration files to enable NHRPD, and ensures that the NHRPD service is running.
- Introduction
- Prerequisites
- Installation
- Usage
- Variables
- Playbook Tasks
- Verification
- Troubleshooting
- License
This playbook performs the following actions:
- Checks if the FRR package is installed on the target servers.
- Modifies the FRR configuration files to enable
nhrpd
. - Ensures the
nhrpd
service is running and enabled on system boot.
- Ansible installed on your control node.
- SSH access to the target servers.
- Sudo privileges on the target servers for the user running the playbook.
- The target servers must have the FRR package installed.
- Clone this repository or download the playbook file:
git clone https://github.com/yourusername/ansible-enable-nhrpd.git
cd ansible-enable-nhrpd
- Ensure your inventory file is set up correctly. Update the
inventory
file with the list of target servers. - (Optional) Modify the
nhrpd_config.yaml
playbook file to suit your environment, especially if using different file paths or configurations.
Run the playbook with the following command:
ansible-playbook -i your_inventory_file nhrpd_config.yaml
Replace your_inventory_file
with the path to your Ansible inventory file.
The following variables are defined in the playbook and can be customized:
frr_conf_path
: Path to the main FRR configuration file (default:/etc/frr/frr.conf
)nhrpd_conf_path
: Path to the nhrpd configuration file (default:/etc/frr/nhrpd.conf
)
To override these variables, you can pass them directly via the command line:
ansible-playbook -i your_inventory_file nhrpd_config.yaml -e "frr_conf_path=/custom/path/frr.conf"
- Check if FRR is installed: Verifies if the FRR package is present on the target server.
- Enable nhrpd in FRR configuration: Adds or updates the
nhrpd
configuration in the FRR configuration file. - Create nhrpd configuration file if not present: Creates a default
nhrpd
configuration file if it does not exist. - Ensure nhrpd is enabled in the FRR daemons file: Ensures
nhrpd
is enabled in the/etc/frr/daemons
file. - Start and enable nhrpd service: Restarts the FRR service to apply changes and ensures it is enabled on boot.
- Verify nhrpd service is running: Checks that the FRR service is active and running.
After running the playbook, verify that nhrpd
is enabled and running with the following command:
systemctl status frr
The output should indicate that the service is active (running)
.
- FRR Not Installed: Ensure that the FRR package is installed on the target servers before running the playbook.
- Permission Denied: Ensure the user running the playbook has sudo privileges on the target servers.
- Service Not Running: Verify that the
nhrpd
configuration is correct and that there are no syntax errors in the configuration files.
This project is licensed under the MIT License - see the LICENSE file for details.
- Introduction: Brief overview of what the playbook does.
- Prerequisites: Lists the requirements needed to run the playbook.
- Installation: Instructions on how to set up and prepare the playbook.
- Usage: Provides a command to run the playbook using Ansible.
- Variables: Describes configurable variables used within the playbook and how to override them.
- Playbook Tasks: Summarizes the main tasks the playbook will perform.
- Verification: How to confirm that
nhrpd
is enabled and running. - Troubleshooting: Common issues and solutions related to the playbook.
- License: Licensing information for the project.
Feel free to modify this README.md
to better match your repository's structure and specific needs.