amazon web services - Ansible -- ec2_group and ec2_tag in the same role? -
i trying ansible role ec2_group definition , ec_tag on same file need have pretty compact.
for ec2_tag need sg_id.. there way of getting value dynamically?
any way of doing this?
roles/region-environment/tasks/env_sg_test.yml
- name: example ec2 group local_action: module: ec2_group name: my-security-group description: access my-security-group vpc_id: "{{ vpc }}" region: "{{ region }}" rules: - proto: tcp from_port: 22 to_port: 22 cidr_ip: 0.0.0.0/0 - proto: tcp from_port: 443 to_port: 443 cidr_ip: 0.0.0.0/0 - name: tag security group name local_action: module: ec2_tag resource: <----- resource. sg_id? region: "{{ region }}" state: present tags: name: "my security group name" env: "production" service: "web"
thanks!!
Comments
Post a Comment