This Ansible playbook generates a report of all the FSx for ONTAP SnapMirror relationships within an AWS account. The output of the report is a CSV file with the following columns:
- File System ID
- Source Path (svm:volume)
- Destination Path (svm:volume)
- State (e.g. snapmirrored, broken-off)
- Healthy (true or false)
- lag_time (in "P#DT#H#M#S" format. See below for an explanation)
The lag_time format is an ASCII string that always starts with the letter 'P' and if the lag time is more than 24 hours it is followed by a number and the letter 'D'. The number represents the number days. The next character is always a 'T' and is followed by number/letter pairs, where the letter is either an 'H', 'M', or 'S'. If the letter is 'H' then the number before it represents the number of hours. If the letter is 'M' then the number before it represents the number of minutes. If the letter is 'S' then the number before it represents the number of seconds. For example, 'P1DT2H3M4S' represents 1 day, 2 hours, 3 minutes, and 4 seconds.
- Ansible 2.9 or later. Installation instructions can be found here
- NetApp ONTAP Ansible collection.
- AWS Ansible collection.
- AWS secret(s) with the credentials necessary to run SnapMirror ONTAP APIs against the FSx for ONTAP file systems. The required format of the secret is described below.
- The
awscli installed and configured. Installation instructions can be found here. This is required to get all the FSxNs within a region, since there isn't an AWS Ansible module that can do that. - A file with a list of the FSx for ONTAP file systems and their corresponding secrets. The format of the file is described below.
There are three components to this playbook:
generate_report.yaml: The main Ansible playbook that calls the other files.get_all_fsxn_regions.yaml: A collection of tasks that retrieves all the regions, that are enabled for the account, where FSx for ONTAP is also available.processs_region.yaml: A collection of tasks that will process all the FSxNs within a region.
You will also need to create a file named (by default) secrets.csv that list the secret name for each FSx file systems.
The format of the file should be:
file_system_id,secret_name
Each secret should have two keys:
| Key | Value |
|---|---|
username |
The username to use to authenticate with the FSx for ONTAP file system. |
password |
The password to use to authenticate with the FSx for ONTAP file system. |
There are a few variables that can be changed at the top of the generate_report.yaml file:
- report_name - Sets the file path of the report that will be generated.
- secrets_list_file - Sets the file path of the file that contains the list of FSx file systems and their secrets. See above for more information.
- secrets_region - Set the region where the secrets are stored.
Since this script leverages the AWS Ansible collection as well as the aws cli, you will need to provide authentication credentials for them.
You can read more about how to do that here.
To generate the report, run the following command:
ansible-playbook generate_report.yamlAfter a successful run, the report will be stored in the file specified by the report_name variable.
This repository is maintained by the contributors listed on GitHub.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, without WARRANTIES or conditions of any kind, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
© 2026 NetApp, Inc. All Rights Reserved.