--- - name: group scale group nodes ec2_remote_facts: region: "{{ openshift_aws_region }}" filters: "{{ {'tag:kubernetes.io/cluster/' ~ openshift_aws_clusterid: openshift_aws_clusterid }}}" register: qinstances - name: Build new node group add_host: groups: oo_sg_new_nodes ansible_ssh_host: "{{ item.public_dns_name }}" name: "{{ item.public_dns_name }}" hostname: "{{ item.public_dns_name }}" when: - (item.tags.version | default(False)) == openshift_aws_new_version - "'node' in item.tags['host-type']" with_items: "{{ qinstances.instances }}" - name: Build current node group add_host: groups: oo_sg_current_nodes ansible_ssh_host: "{{ item.public_dns_name }}" name: "{{ item.public_dns_name }}" hostname: "{{ item.public_dns_name }}" when: - (item.tags.version | default('')) == openshift_aws_current_version - "'node' in item.tags['host-type']" with_items: "{{ qinstances.instances }}" - name: place all nodes into nodes group add_host: groups: nodes ansible_ssh_host: "{{ item.public_dns_name }}" name: "{{ item.public_dns_name }}" hostname: "{{ item.public_dns_name }}" with_items: "{{ qinstances.instances }}"