Thanks for the reply, apologies for late response.

I *think* the command "ssh user@fuel-server /path/to/fuel.py" attempts to 
run the command "/path/to/fuel.py" on the fuel-server. In any case the 
script fails.

I tried altering the dynamic inventory to that below.

#!/bin/bash
ssh <user@fuel-server> 'bash -s' < ./fuel.py

I can run the script from the command line of the Ansible server but it 
spits back what I think is a fuel client error. The same happens when I try 
to use the script as a dynamic inventory with Ansible (ansible -i 
dyn-invent all -m ping).

vagrant@ansible:~/playbooks/test-env$ ./dyn-invent
bash: line 3: import: command not found
bash: line 4: import: command not found
bash: line 5: import: command not found
bash: line 6: import: command not found
bash: line 7: import: command not found
bash: line 8: from: command not found
bash: line 9: from: command not found
usage:
            fuel [optional args] <namespace> [action] [flags]

            DEPRECATION WARNING:

                In an upcoming release of Fuel Client, the syntax will
<snip snip>


On Sunday, 10 July 2016 18:31:56 UTC+3, Kai Stian Olstad wrote:
>
> On 10. juli 2016 11:08, Rod Oliver wrote: 
> > I have found a dynamic inventory script 
> > (https://github.com/martineg/ansible-fuel-inventory) for Mirantis Fuel 
> that 
> > runs just fine on the Fuel host itself. In my case I can't install 
> Ansible 
> > on the Fuel server so need to to run the dynamic inventory script 
> remotely. 
> > I guess there ought to be a way to do this via SSH. Can anyone suggest 
> how 
> > to do this simply and preferably without modifying the dynamic inventory 
> > script itself? 
>
> I guess this should work, but you'll need to set up ssh keys between 
> Ansible control machine and the fuel server. 
> Make a script(here called my_script.sh) on Ansible control machine and 
> make it executable. 
>
> #!/bin/bash 
> ssh user@fuel-server /path/to/fuel.py 
>
> Then you can run ansible/ansible-playbook with 
> -i my_script.sh 
> or change ansible.cfg accordingly. 
>
> -- 
> Kai Stian Olstad 
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4a427e4f-af0b-4555-ad99-258dbefbf54b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to