Hi
I have a task to ensure that an instance is available and configured.
But now I'd like make sure the instance has a few extra security
groups, but I can't find the correct syntax to get this working.
My task look like this:
- name: Ensure jumphost is available
ec2_instance:
tags:
Name: Jumphost
filters:
tag:Name: Jumphost
private-ip-address: 10.0.0.12
image_id: ami-blah12121
vpc_subnet_id: 1234
network:
source_dest_check: false
description: some_description
private_ip_address: 10.0.0.12
security_groups:
- public_ssh
- nat_sg
The task runs OK without changes, but the instance does not get these
security groups added.
It just has the default security group.
I've tried a few things:
1. Use a list of group_id's of each security group (as opposed to the names)
2. Add those group names or group_ids to a list called 'groups' as
part of the 'network' parameter
But still no joy.
Any ideas how to configure the security groups of an instance with the
ec2_module?
thx