-testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222
+testserver ansible_host=127.0.0.1 ansible_port=2222
[webservers]
-testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222
+testserver ansible_host=127.0.0.1 ansible_port=2222
config = paramiko.SSHConfig()
config.parse(p.stdout)
c = config.lookup(host)
- return {'ansible_ssh_host': c['hostname'],
- 'ansible_ssh_port': c['port'],
- 'ansible_ssh_user': c['user'],
- 'ansible_ssh_private_key_file': c['identityfile'][0]}
+ return {'ansible_host': c['hostname'],
+ 'ansible_port': c['port'],
+ 'ansible_user': c['user'],
+ 'ansible_private_key_file': c['identityfile'][0]}
def main():
[vagrant]
-server1 ansible_ssh_host=192.168.4.10 ansible_ssh_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/ubuntu/virtualbox/private_key
-server2 ansible_ssh_host=192.168.4.11 ansible_ssh_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/centos/virtualbox/private_key
-server3 ansible_ssh_host=192.168.4.12 ansible_ssh_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/precise/virtualbox/private_key
+server1 ansible_host=192.168.4.10 ansible_user=vagrant ansible_private_key_file=.vagrant/machines/ubuntu/virtualbox/private_key
+server2 ansible_host=192.168.4.11 ansible_user=vagrant ansible_private_key_file=.vagrant/machines/centos/virtualbox/private_key
+server3 ansible_host=192.168.4.12 ansible_user=vagrant ansible_private_key_file=.vagrant/machines/precise/virtualbox/private_key
[ubuntu]
-web ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222
+web ansible_host=127.0.0.1 ansible_port=2222
- name: Deploy mezzanine
hosts: web
vars:
- user: "{{ ansible_ssh_user }}"
+ user: "{{ ansible_user }}"
proj_name: mezzanine-example
venv_home: "{{ ansible_env.HOME }}"
venv_path: "{{ venv_home }}/{{ proj_name }}"
---
# vars file for mezzanine
-mezzanine_user: "{{ ansible_ssh_user }}"
+mezzanine_user: "{{ ansible_user }}"
mezzanine_venv_home: "{{ ansible_env.HOME }}"
mezzanine_venv_path: "{{ mezzanine_venv_home }}/{{ mezzanine_proj_name }}"
mezzanine_repo_url: git@github.com:lorin/mezzanine-example.git
-Defaults:{{ ansible_ssh_user }} !requiretty
+Defaults:{{ ansible_user }} !requiretty
-testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222
+testserver ansible_host=127.0.0.1 ansible_port=2222