elb_application_lb purge rules option (#43113)

* Add parameter to keep elb rules

Does not purge elb rules. This is usefull if running the elb_application_lb
 role and there is the desire to keep existing rules.

* Change variable name keep_rules to purge_rules

The descriptor purge has been used in the past.

* Changed default for purge_rules

Default is purge_rules. This is how the module has functioned previously. This change maintains
 the previous behavior.

* Add integration test for purge_rules flag

* Change wording of test task

* Fix merge conflcit

* Changed default for purge_rules

Default is purge_rules. This is how the module has functioned previously. This change maintains
 the previous behavior.

* merge conflcit

* Change wording of test task

* Add purge_rules option to test

* Change test description wording

* Expand purge_rules documentation

* Clarifies documentation for purge_rules option
This commit is contained in:
mjmayer 2018-07-25 03:55:34 -07:00 committed by Will Thames
commit a488b3a8ed
2 changed files with 43 additions and 5 deletions

View file

@ -88,6 +88,36 @@
- not alb.changed
- alb.listeners[0].rules|length == 2
- name: test a rule can be added and other rules will not be removed when purge_rules is no.
elb_application_lb:
name: "{{ alb_name }}"
subnets: "{{ alb_subnets }}"
security_groups: "{{ sec_group.group_id }}"
state: present
purge_rules: no
listeners:
- Protocol: HTTP
Port: 80
DefaultActions:
- Type: forward
TargetGroupName: "{{ tg_name }}"
Rules:
- Conditions:
- Field: path-pattern
Values:
- '/new'
Priority: '2'
Actions:
- TargetGroupName: "{{ tg_name }}"
Type: forward
<<: *aws_connection_info
register: alb
- assert:
that:
- alb.changed
- alb.listeners[0].rules|length == 3
- name: remove the rule
elb_application_lb:
name: "{{ alb_name }}"