|
| 1 | +# Ansible Inventory Report |
| 2 | +This Ansible playbook generates a report of all the FSx for ONTAP file systems within an AWS account. |
| 3 | +In includes all the SVMs and Volumes. The format of the report is as follows: |
| 4 | +``` |
| 5 | +Region: <region_name> |
| 6 | + File System ID: <file-system-id-1> |
| 7 | + SVM ID: <svm-id-1-1> |
| 8 | + Volumes: |
| 9 | + <volume-id-1-1-1> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name> |
| 10 | + <volume-id-1-1-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name> |
| 11 | + SVM ID: <svm-id-1-2> |
| 12 | + Volumes: |
| 13 | + <volume-id-1-2-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name> |
| 14 | + <volume-id-1-2-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name> |
| 15 | + File System ID: <file-system-id-2> |
| 16 | + SVM ID: <svm-id-2-1> |
| 17 | + Volumes: |
| 18 | + <volume-id-2-1-1> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name> |
| 19 | + <volume-id-2-1-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name> |
| 20 | + SVM ID: <svm-id-2-2> |
| 21 | + Volumes: |
| 22 | + <volume-id-2-2-1> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name> |
| 23 | + <volume-id-2-2-2> <volume-type> <security-style> <volume-size-in-megabytes> <volume-name> |
| 24 | +``` |
| 25 | +Where: |
| 26 | + - \<volume-size-in-megabytes> is the provisioned size of the volume in megabytes. |
| 27 | + - \<security-style> is the security style of the volume (e.g. UNIX, NTFS). |
| 28 | + - \<volume-type> is the type of the volume (e.g. RW, DP). |
| 29 | + |
| 30 | +## Requirements |
| 31 | +- jq - A lightweight and flexible command-line JSON processor. Installation instructions can be found [here](https://jqlang.github.io/jq/download/) |
| 32 | +- Ansible 2.9 or later. Installation instructions can be found [here](https://docs.ansible.com/ansible/latest/installation_guide/index.html) |
| 33 | +- AWS Ansible collection. This should be included with the base installation of Ansible. |
| 34 | + |
| 35 | +## Installation |
| 36 | +There are three files used to create the report: |
| 37 | +- `generate_report.yaml`: The Ansible playbook that generates the report. |
| 38 | +- `processs_region.yaml`: A collection of tasks that will process all the FSxNs in a region. |
| 39 | +- `get_all_fsxn_regions.yaml`: A collection of tasks that retrieves all the AWS regions, that are enabled for the account, where FSx for ONTAP is available. |
| 40 | + |
| 41 | +## Configuration |
| 42 | +There are a variable that can be changed at the top of the `generate_report.yaml` file: |
| 43 | +- report\_name - Sets the file path of the report that will be generated. |
| 44 | + |
| 45 | +Since this script leverages the AWS Ansible collection as well as the `aws` cli, you will need to provide authentication credentials for them. |
| 46 | +You can read more about how to do that [here](https://docs.ansible.com/ansible/latest/collections/amazon/aws/docsite/aws_ec2_guide.html#authentication). |
| 47 | + |
| 48 | +## Usage |
| 49 | +To generate the report copy the three files mentioned above and run the following command: |
| 50 | +```bash |
| 51 | +ansible-playbook generate_report.yaml |
| 52 | +``` |
| 53 | + |
| 54 | +## Author Information |
| 55 | + |
| 56 | +This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors). |
| 57 | + |
| 58 | +## License |
| 59 | + |
| 60 | +Licensed under the Apache License, Version 2.0 (the "License"). |
| 61 | + |
| 62 | +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0). |
| 63 | + |
| 64 | +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. |
| 65 | + |
| 66 | +See the License for the specific language governing permissions and limitations under the License. |
| 67 | + |
| 68 | +© 2024 NetApp, Inc. All Rights Reserved. |
0 commit comments