Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixing date and time formatting and adding a debug task
  • Loading branch information
VickieKarasic committed Oct 25, 2024
commit 3140dfd1b30e71cf7fd0c97be3ee6d19755a558d
10 changes: 7 additions & 3 deletions playbooks/utils/veeam_backup_list_to_csvs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
ansible.builtin.set_fact:
unique_tags: "{{ vms_and_tags.virtual_machines | map(attribute='tags') | flatten | map(attribute='name') | unique }}"

- name: Debug for find all unique tags
ansible.builtin.debug:
var: vms_and_tags

- name: Create CSV file for tags
copy:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
copy:
ansible.builtin.copy:

dest: "/tmp/tags_report.csv"
Expand All @@ -38,7 +42,7 @@
- name: Append report date and time to tags CSV
lineinfile:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lineinfile:
ansible.builtin.lineinfile:

path: "/tmp/tags_report.csv"
line: "Report Date/Time {{ lookup('pipe', 'date +%m.%d.%Y %H:%M') }}"
line: "Report Date/Time {{ lookup('pipe', \"date '+%m.%d.%Y %H:%M'\") }}"
delegate_to: localhost

- name: Find VMs without tags
Expand All @@ -61,7 +65,7 @@
- name: Append report date and time to untagged VMs CSV
lineinfile:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lineinfile:
ansible.builtin.lineinfile:

path: "/tmp/untagged_vms_report.csv"
line: "Report Date/Time {{ lookup('pipe', 'date +%m.%d.%Y %H:%M') }}"
line: "Report Date/Time {{ lookup('pipe', \"date '+%m.%d.%Y %H:%M'\") }}"
delegate_to: localhost

- name: Find VMs with tags
Expand Down Expand Up @@ -90,5 +94,5 @@
- name: Append report date and time to tagged VMs CSV
lineinfile:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lineinfile:
ansible.builtin.lineinfile:

path: "/tmp/tagged_vms_report.csv"
line: "Report Date/Time {{ lookup('pipe', 'date +%m.%d.%Y %H:%M') }}"
line: "Report Date/Time {{ lookup('pipe', \"date '+%m.%d.%Y %H:%M'\") }}"
delegate_to: localhost
Loading