Skip to content

Commit

Permalink
fix var name
Browse files Browse the repository at this point in the history
  • Loading branch information
willtome committed Aug 30, 2023
1 parent ffb8adc commit a93f306
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cloud/facts_bucket.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
- name: collect host facts
hosts: "{{ _hosts }}"
vars:
facts_aws_region: us-east-2
facts_aws_bucket_prefix: "{{ lookup('ansible.builtin.env', 'AWS_ACCESS_KEY_ID')[1:5] | lower }}"
facts_aws_bucket_name: "{{ reports_aws_bucket_prefix }}-facts"

tasks:
- name: store facts
Expand All @@ -17,16 +21,16 @@

- name: Create report bucket
amazon.aws.s3_bucket:
name: "{{ reports_aws_bucket_name }}"
region: "{{ reports_aws_region }}"
name: "{{ facts_aws_bucket_name }}"
region: "{{ facts_aws_region }}"
state: present
object_ownership: BucketOwnerPreferred
delegate_to: localhost
run_once: true

- name: Put facts
amazon.aws.s3_object:
bucket: "{{ reports_aws_bucket_name }}"
bucket: "{{ facts_aws_bucket_name }}"
object: "{{ inventory_hostname }}/{{ ansible_facts.date_time.iso8601 }}.json"
content: "{{ facts_dump | to_nice_json}}"
mode: put
Expand Down

0 comments on commit a93f306

Please sign in to comment.