You can collect information about your current environment in multiple ways: by using vendor-specific *_facts modules, by querying settings saved in backup files, or by using the network.base.resource_manager role.
You can use Jinja2 templates to dynamically customize files by inserting the values of variables into those files when you deploy them.
You can use Jinja2 templates to customize the configuration of specific managed nodes, and you can create files by using Jinja2 templates that contain information that the play has collected and stored in variables.
You can use a combination of information collection techniques and Jinja2 templates to create dynamically updated documentation of your current network configuration.
You can use the platform-independent ansible.netcommon and network.base Ansible Content Collections to work with multiple network resource modules rather than using vendor-specific resource modules.
You can limit the impact of playbook failures by adding the serial and max_fail_percentage keywords to a play.
You can use the serial keyword to configure Ansible to run through a play in batches.
You can use the max_fail_percentage keyword to configure Ansible to abort the play if more than a certain percentage of nodes in the current batch fail.