Skip to content

Commit 1d77fb3

Browse files
committed
Initial Version.
1 parent b1c5276 commit 1d77fb3

File tree

8 files changed

+31
-22
lines changed

8 files changed

+31
-22
lines changed

Ansible/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Ansible is a general purpose automation engine. It can be used to automate most repetitive IT tasks.
33
The typical input you provide Ansible is a "Playbook." This folder holds various playbooks that can be used
44
to help automate tasks around the management of a FSx for ONTAP file system.
5-
Click here for more information an [Ansible](https://www.ansible.com/).
5+
Click here for more information on [Ansible](https://www.ansible.com/).
66

77
| Tool | Description |
88
| --- | --- |

Ansible/fsx_inventory_report/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ansible-playbook generate_report.yaml
2424

2525
## Output
2626
After a successful run, the report will be saved to the file path specified in the `report_name` variable.
27-
The fommat of the report is as follows:
27+
The format of the report is as follows:
2828
```
2929
Region: <region_name>
3030
File System ID: <file-system-id-1>

Ansible/fsx_inventory_report/generate_report.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#
2-
# This Ansible playbook generates a SnapMirror lag time report for all the
3-
# SnapMirror relationships, in all the FSxNs, in all regions,
2+
# This Ansible playbook generates an inventory report for all the FSXNs
3+
# in all the AWS regions for the account that it is running under.
44
#################################################################################
55
---
66
- vars:
7-
report_name: output.csv
8-
secrets_list_file: secrets.csv
9-
secrets_region: us-west-2
7+
report_name: output.txt
108
#################################################################################
119
#
1210
# Don't change anything below this line.
@@ -15,18 +13,18 @@
1513
fsxn_regions: []
1614
opted_in_regions: []
1715

18-
name: Playbook to generate a SnapMirror report on all the FSxNs.
16+
name: Playbook to generate an inventory report on all the FSxNs.
1917
hosts: localhost
2018
collections:
2119
- amazon.aws
2220
gather_facts: false
2321

2422
tasks:
25-
- name: Delete previous report while adding the header line.
23+
- name: Make sure the report file is empty.
2624
ansible.builtin.shell:
27-
cmd: echo fs,source,destination,state,healthy,lag_time > {{ report_name }}
25+
cmd: echo "" > {{ report_name }}
2826

29-
- name: Get all the regions that support FSxN that I am opted into.
27+
- name: Get all the regions that support FSxN that are opted into.
3028
include_tasks: get_fsxn_regions.yaml
3129

3230
- name: Generate the report for all the FSxNs.

Ansible/fsx_inventory_report/get_fsxn_regions.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#
2+
# These tasks are used to set a variable named 'fsnx_regions' that contains a
3+
# list of regions that support FSxN and are opted-in.
4+
################################################################################
15
- name: Get all the opted-in regions
26
amazon.aws.aws_region_info:
37
register: region_info
@@ -21,6 +25,6 @@
2125
| list
2226
}}
2327
24-
- name: Output the FSxN regions
25-
debug:
26-
msg: "fsxn_regions={{ fsxn_regions }}"
28+
#- name: Output the FSxN regions
29+
# debug:
30+
# msg: "fsxn_regions={{ fsxn_regions }}"

Ansible/fsx_inventory_report/process_region.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#
2-
# Since Ansible can't handle nested loops, this is a block of tasked that is run
3-
# for each region. It assume that the calling playbook used 'region' as its loop variable.
2+
# Since Ansible can't handle nested loops, this is a block of tasked that is
3+
# run for each region. It assume that the calling playbook used 'region' as
4+
# its loop variable.
5+
################################################################################
46
---
57
- name: Get all the FSxNs for the specified region.
68
ansible.builtin.shell:

Ansible/snapmirror_report/generate_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This Ansible playbook generates a SnapMirror lag time report for all the
2+
# This Ansible playbook generates a SnapMirrorreport for all the
33
# SnapMirror relationships, in all the FSxNs, in all regions,
44
#################################################################################
55
---

Ansible/snapmirror_report/get_fsxn_regions.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#
2+
# These tasks are used to set a variable named 'fsnx_regions' that contains a
3+
# list of regions that support FSxN and are opted-in.
4+
################################################################################
15
- name: Get all the opted-in regions
26
amazon.aws.aws_region_info:
37
register: region_info
@@ -21,6 +25,6 @@
2125
| list
2226
}}
2327
24-
- name: Output the FSxN regions
25-
debug:
26-
msg: "fsxn_regions={{ fsxn_regions }}"
28+
#- name: Output the FSxN regions
29+
# debug:
30+
# msg: "fsxn_regions={{ fsxn_regions }}"

Ansible/snapmirror_report/process_region.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#
2-
# Since Ansible can't handle nested loops, this is a block of tasked that is run
3-
# for each region. It assume that the calling playbook used 'region' as its loop variable.
2+
# Since Ansible can't handle nested loops, this is a block of tasked that is
3+
# run for each region. It assume that the calling playbook used 'region' as its loop variable.
4+
#################################################################################
45
---
56
- name: Get all the FSxNs for the specified region.
67
ansible.builtin.shell:

0 commit comments

Comments
 (0)