Created
September 7, 2016 09:42
-
-
Save palmerabollo/9db23359d11290765a8e40b7bf2ac367 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: Release chaos monkey | |
| hosts: localhost | |
| gather_facts: true | |
| connection: local | |
| vars: | |
| probability: 5 | |
| tasks: | |
| - name: Kill random instances belonging to hostgroups with multiple instances | |
| os_server: | |
| name: "{{ item.key }}-{{ deployment_group_env }}-{{ item.value | length | random + 1 }}" | |
| state: absent | |
| when: | | |
| 100 | random < probability and | |
| item.key not in ['all', 'localhost', 'ungrouped'] and | |
| item.value | length > 1 | |
| with_dict: "{{ groups }}" | |
| - name: Show hostgroups information after chaosmonkey | |
| debug: var={{ groups }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment