Hi Henry,

I am most definitely stupider than normal; I blame a recent pigeon 
infestation and the resulting lack of sleep.

I did not find that script on my system, so I downloaded it from here 
https://github.com/ansible/ansible/blob/release1.6.2/plugins/inventory/ssh_config.py.
 
It appears to be throwing a python error:
[prod_deploy@srvtoolbox ansible]$ ./ssh_config.py --list
Traceback (most recent call last):
  File "./ssh_config.py", line 111, in <module>
    main(sys.argv[1:])
  File "./ssh_config.py", line 105, in main
    print_list()
  File "./ssh_config.py", line 72, in print_list
    cfg = get_config()
  File "./ssh_config.py", line 67, in get_config
    ret_dict[host] = _copy['config']
KeyError: 'config'

I think you wrote it? Perhaps it would be better if I went away and hunted 
some pigeons, and got some sleep, and then come back. I feel like I'm 
getting closer to a solution, even if I'm not getting any smarter. 

Have you got  a suggestion for next steps? Thank you for your patience,

On Wednesday, July 9, 2014 11:03:54 AM UTC-4, Henry Finucane wrote:
>
> Ansible only wants to talk to hosts in its inventory. If you want your 
> inventory to be your ssh config file, there is a dynamic inventory script 
> called 'ssh_config.py' that ships with ansible that will do that for you.
> On Jul 9, 2014 7:56 AM, "Simon Tyler" <simon.syst...@gmail.com 
> <javascript:>> wrote:
>
>> ok clearly I am doing something dumb.
>>
>> I have an entry in ~/.ssh/config for destination host: tmdb02
>> Host tmdb02
>>   User prod_deploy
>>   HostName 10.124.33.250
>>   ProxyCommand ssh -q terremarkjump ncat %h 22
>>
>> I can ssh to it normally eg. ssh tmdb02
>>
>> I've updated a test playbook to use the new server name syntax eg.
>> - hosts: "{{server_name}}"
>>   user: prod_deploy
>>   sudo: yes
>>   tasks:
>> # Store file into /tmp/fetched/host.example.com/tmp/somefile
>>          - name: get INVENTORY
>>            action: fetch src=/etc/my.cnf dest=~
>>
>> I try to run it:
>>
>> ansible-playbook /home/prod_deploy/simontest/fetch_mysql_config2.yml 
>> --extra-vars="server_name=jruby03"
>>
>> and this works: jruby03 is listed in /etc/ansible/hosts
>>
>> If I try a name that is listed in my ssh config, it fails as previously 
>> indicated. So, I need to add an entry or two to /etc/ansible/hosts. The 
>> server I'm trying to hit is on the other side of a jump server. How do i 
>> set this up in /etc/ansible/hosts?
>>
>>
>>
>> On Wed, Jul 9, 2014 at 9:58 AM, Henry Finucane <h.fin...@gmail.com 
>> <javascript:>> wrote:
>>
>>>
>>> On Jul 9, 2014 6:48 AM, "Simon Tyler" <simon.syst...@gmail.com 
>>> <javascript:>> wrote:
>>> >
>>> > ok i havent used Ansible before. Are you saying I don't have to pass 
>>> any switch to use SSH; it uses Paramiko and if it doesn't find a hostname, 
>>> it tries ssh config? it just keeps giving me the error"No hosts matched",
>>>
>>> Current versions of ansible use openssh as a library for connections by 
>>> default. You can also ask ansible to use paramiko instead. If you're using 
>>> openssh, your ssh config will get picked up, if you're using paramiko, it 
>>> won't.
>>>
>>> "No hosts matched" is, I believe, unrelated- it means that there are no 
>>> hosts in your inventory in the specified group.
>>>
>>> > On Tuesday, July 8, 2014 10:37:58 PM UTC-4, Brian Coca wrote:
>>> >>
>>> >> The $ variables have been dropped from current ansible, they have 
>>> been deprecated for a loong time. The new way to do the host variables 
>>> would be writing plays like this:
>>> >>
>>> >> hosts: "{{server_name}}" 
>>> >>
>>> >> and pass on the command line as before, there is some more advanced 
>>> stuff you can do now, like using --limit or doing this
>>> >>
>>> >> hosts: "{{server_name|default('all')}}" 
>>> >>
>>> >>
>>> >> the ssh config should be picked up normally, I still use it for some 
>>> bastion jump hosts w/o issues.
>>> >> ​
>>> >
>>> > -- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups "Ansible Project" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to ansible-proje...@googlegroups.com <javascript:>.
>>>
>>> > To post to this group, send email to ansible...@googlegroups.com 
>>> <javascript:>.
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/6935e31d-d83e-4987-9f07-bf0f0937806d%40googlegroups.com
>>> .
>>> >
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>  -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Ansible Project" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/ansible-project/1sYMJ1uTAws/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to 
>>> ansible-proje...@googlegroups.com <javascript:>.
>>> To post to this group, send email to ansible...@googlegroups.com 
>>> <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/CAGYSzJ_nuP9rUS224TWUhmNMssr_TeSbq6fOGobcOXdP%2BpgehQ%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/ansible-project/CAGYSzJ_nuP9rUS224TWUhmNMssr_TeSbq6fOGobcOXdP%2BpgehQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible-proje...@googlegroups.com <javascript:>.
>> To post to this group, send email to ansible...@googlegroups.com 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CADiFY2fYb%2BJa5TS92po4A0eNhC23EMo%2BpCsqC4PmrAy11yEJZg%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/CADiFY2fYb%2BJa5TS92po4A0eNhC23EMo%2BpCsqC4PmrAy11yEJZg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ee6d7ecd-28b7-4a7c-a934-f1b91d5f7902%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to