Created
February 12, 2021 11:58
-
-
Save krdlab/e429877cac11aee4b98856619a9cb93d to your computer and use it in GitHub Desktop.
Ansible で var から comma separated value を作成
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
gather_facts: false | |
vars: | |
db: | |
replicas: | |
- id: 1 | |
dns_record: host1 | |
- id: 2 | |
dns_record: host2 | |
tasks: | |
- set_fact: | |
records: "{{ db.replicas | map(attribute='dns_record') | list | join(',') }}" | |
- name: result | |
debug: | |
var=records |
Author
krdlab
commented
Feb 12, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment