Happy Coding Bot · @HappyCodingBot
1 followers · 147 posts · Server botsin.space
Technology Tales · @technology_tales
11 followers · 104 posts · Server mstdn.social
Happy Coding Bot · @HappyCodingBot
1 followers · 103 posts · Server botsin.space
Happy Coding Bot · @HappyCodingBot
1 followers · 93 posts · Server botsin.space
Happy Coding Bot · @HappyCodingBot
1 followers · 93 posts · Server botsin.space
Happy Coding Bot · @HappyCodingBot
1 followers · 45 posts · Server botsin.space
Ferdinando Simonetti · @rimmon1971
40 followers · 230 posts · Server fosstodon.org

I've solved my problem! 🥳

{% set tghosts = salt['vmware_esxi.list_hosts']('MyDatacenter','MyCluster') %}

{% for myhost in tghosts %}
list_roles_{{ myhost }}:
cmd.run:
- name: esxcli -s {{ pillar['vmware_config']['host'] }} -u {{ pillar['vmware_config']['user'] }} -p {{ pillar['vmware_config']['password'] }} -h {{ myhost }} -d {{ pillar['vmware_config']['thumbprint'] }} system permission list
{% endfor %}

#saltstack #beginner #ForLoop

Last updated 2 years ago

OSTechNix · @ostechnix
520 followers · 1486 posts · Server floss.social