Last active
December 28, 2015 06:29
-
-
Save jctanner/7457226 to your computer and use it in GitHub Desktop.
language examples
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: install formulas | |
action: > | |
homebrew | |
{% if item is mapping %} | |
name={{item.name}} state=present | |
{% if 'options' in item %} | |
install_options={{item.options}} | |
{% endif %} | |
{% else %} | |
name={{item}} state=present | |
{% endif %} | |
with_items: | |
- macvim | |
- { name: aspell, options: "with-lang-fr,with-lang-en" } | |
===================================================================== | |
# LOOP LININFILE UNTIL NO MATCHES FOUND | |
- hosts: localhost | |
connection: local | |
gather_facts: False | |
vars: | |
lines: | |
- a | |
- a | |
- a | |
- a | |
tasks: | |
- shell: rm /tmp/listfile | |
ignore_errors: True | |
- shell: echo {{ item }} >> /tmp/listfile | |
with_items: lines | |
- lineinfile: dest=/tmp/listfile line="b" regexp='^a' | |
register: result | |
until: result.msg != "line replaced" | |
retries: 100 | |
delay: 0 | |
- debug: var=result | |
===================================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment