Last active
October 7, 2016 13:52
-
-
Save lanky/20f28ab072e9a991928eb9700255bc86 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
--- | |
# vim: set ft=ansible: | |
- name: find files | |
hosts: localhost | |
tasks: | |
- name: find local configuration files | |
find: | |
paths: resources-minimal | |
patterns: "*.yml" | |
register: configfiles | |
- name: push and test | |
hosts: hostA:hostB | |
tasks: | |
- include: repeatme.yml | |
with_items: "{{ configfiles.files }}" | |
################# repeatme.yml ########### | |
--- | |
# task include file, run once for each item in our file list | |
- name: copy config file | |
copy: | |
src: "{{ item }}" | |
dest: /path/to/destination | |
when: inventory_hostname == "hostA" | |
- name: reload service on hostA | |
service: | |
name: myservice | |
state: restarted | |
when: inventory_hostname == "hostA" | |
- name: perform GET test from B | |
get_url: | |
url: URL TO HOST A | |
when: inventory_hostname == hostB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment