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.finuc...@gmail.com> wrote:

>
> On Jul 9, 2014 6:48 AM, "Simon Tyler" <simon.systems.supp...@gmail.com>
> 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-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/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-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/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-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/CADiFY2fYb%2BJa5TS92po4A0eNhC23EMo%2BpCsqC4PmrAy11yEJZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to