Created
May 2, 2022 09:44
-
-
Save krdlab/415b32889e3b3e124baae0f7d06613e9 to your computer and use it in GitHub Desktop.
Ansible で差集合を作る
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 | |
connection: local | |
gather_facts: false | |
vars_files: | |
- group_vars/{{ stage }}/all.yml | |
- group_vars/{{ stage }}/aws.yml | |
tasks: | |
- set_fact: | |
r5: "{{ aws.ec2.searches | selectattr('instance_type', 'match', '^r5\\..+') | list }}" | |
- debug: | |
msg: "{{ aws.ec2.searches | reject('in', r5) | list }}" # NOTE: searches - r5 になる |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref. https://stackoverflow.com/a/50261140