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 | |
gather_facts: false | |
tasks: | |
- name: Create the security group | |
ec2_group: | |
name: sshonly |
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: my sudo task | |
command: uptime | |
sudo: yes |
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
[root@awxbox2 ~]# supervisorctl stop awx-celeryd | |
^[[A^CTraceback (most recent call last): | |
File "/usr/bin/supervisorctl", line 6, in <module> | |
main() | |
File "/usr/lib/python2.6/site-packages/supervisor/supervisorctl.py", line 598, in main | |
c.onecmd(" ".join(options.args)) | |
File "/usr/lib/python2.6/site-packages/supervisor/supervisorctl.py", line 86, in onecmd | |
return func(arg) | |
File "/usr/lib/python2.6/site-packages/supervisor/supervisorctl.py", line 433, in do_stop | |
result = supervisor.stopProcess(processname) |
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: Terminate legacy instance(s) | |
ec2: | |
region: '{{ region }}' | |
zone: '{{ zone }}' | |
keypair: '{{ keypair }}' | |
group: '{{ security_group }}' | |
image: '{{ image }}' | |
instance_ids: '{{ ansible_ec2_instance_id }}' | |
state: absent | |
wait: yes |
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
Space-separated values: {{ (l1+l2+l3)|join(" ") }} |
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
diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py | |
index 1755879..d305a38 100644 | |
--- a/lib/ansible/runner/__init__.py | |
+++ b/lib/ansible/runner/__init__.py | |
@@ -411,6 +411,7 @@ class Runner(object): | |
inject = utils.combine_vars(inject, self.module_vars) | |
inject = utils.combine_vars(inject, self.setup_cache[host]) | |
inject.setdefault('ansible_ssh_user', self.remote_user) | |
+ inject.setdefault('ansible_connection', host_connection) | |
inject['hostvars'] = HostVars(self.setup_cache, self.inventory) |
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
Timothys-MacBook-Pro:ansible-test tgerla$ tree | |
. | |
├── roles | |
│ └── myrole | |
│ └── tasks | |
│ └── main.yml | |
├── templates | |
│ └── mytemplate.j2 | |
└── test-roles.yml |
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 | |
tasks: | |
# this task runs 'getenforce' and registers the result into the "sestatus" variable | |
# changed_when: false tells ansible never to mark this task as "changed" | |
- name: test to see if selinux is running | |
command: getenforce |
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: my thing | |
command: this might fail or whatever | |
failed_when: false | |
register: testcommand |
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
Timothys-MacBook-Pro:ansible-test tgerla$ ansible-playbook -i localhost, test-includes.yml -e myvar=this | |
PLAY [localhost] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [debug msg=hi] ********************************************************** | |
skipping: [localhost] |