Closed lndevnull closed 5 years ago
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @bannaych @genegr @lionmax @raekins @sdodsley @sile16 click here for bot help
cc @opslounge click here for bot help
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @dnix101 click here for bot help
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
@lndevnull As you can see purefa_facts is going to be deprecated in favour of purefa_info as per the new requirements from the core team. You may want to try something along these lines:
vars:
pure_fa_cfg:
purestorage_cluster1:
fa_url: purestorage_cluster1
api_token: secret_token_1
purestorage_cluster2:
fa_url: purestorage_cluster2
api_token: secret_token_2
tasks:
- purefa_info:
fa_url: "{{ item.value.fa_url }}"
api_token: "{{ item.value.api_token }}"
gather_subset:
- volumes
register: volumes
with_items: "{{ pure_fa_cfg|dict2items }}"
delegate_to: localhost
- debug: var={{item.purefa_info.volumes}}
with_items: "{{volumes.results}}"
notabug
SUMMARY
Subsequent calls to purefa_facts in a playbook overrides the ansible_purefa_facts dict rather than merging
ISSUE TYPE
COMPONENT NAME
lib/ansible/modules/storage/purestorage/purefa_facts.py
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Run purefa_facts in a loop and rather than merging or appending the facts are overwritten. This can be an issue if you're trying to pull facts from multiple PureStorage endpoints.
EXPECTED RESULTS
I would expect that the hostvars[inventory_hostname][\"ansible_facts\"][\"purefa_facts\"][\"volumes\"] dict be append to rather than overwritten. This may not be best practice so I would be open to ideas on how to handle it.
ACTUAL RESULTS