How to pass an array via local-exec

I have a local-exec provisioner. I have a ansible playbook I’m trying to pass a list of private_ips. The line looks like: command = “ansible-playbook -e ‘hostname=elastic-master-{count.index + 1} node_type=master environ={var.environ} master_list={aws_instance.elastic-master.*.private_ip}' -u ec2-user -i '{self.private_ip},’ --private-key ‘~/.ssh/id_rsa’ packages.yml”

So, it seems the section “master_list=${aws_instance.elastic-master.*.private_ip}” is the problem.