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
- debug: msg="should not appear" |
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: run the command | |
command: mycommand | |
register: myCommandResults | |
- name: fail if we didn't get what we expect | |
assert: | |
that: '"my output" in myCommandResults' |
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
# define these as empty groups | |
[tag_Name_mysql] | |
... | |
[mysql:children] | |
tag_Name_mysql | |
------------------------------------------ |
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
--- | |
- hosts: localhost | |
connection: local | |
vars: | |
fake_group_names: | |
- web | |
- db | |
tasks: |
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
{% for i in range(ent_count) %} | |
{{ i }} | |
{% endfor %} |
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
--- | |
- hosts: all | |
remote_user: root | |
tasks: | |
- name: Say bar | |
shell: echo "bar" |
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
--- | |
- hosts: all | |
gather_facts: false | |
tasks: | |
- name: test possible passwords | |
local_action: shell sshpass -p {{ item }} ssh {{ user }}@{{ inventory_hostname }} date | |
register: pastpass | |
ignore_errors: true |
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
--- | |
# this play queries all servers and creates groups | |
- hosts: all | |
remote_user: root | |
# remote_user: someuser | |
# sudo: true | |
tasks: | |
- name: create dynamic groups based on OS | |
group_by: key=ansible_os_family |
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: Stage instance(s) | |
hosts: local | |
connection: local | |
user: root | |
gather_facts: false | |
vars: | |
keypair: mykeypair | |
instance_type: m1.small | |
security_group: default |
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
[us_east:children] | |
us_east_dmz_servers | |
us_east_db_servers | |
[us_east_dmz_servers] | |
server1 | |
[us_east_db_servers] | |
server2 |