Hi Kai, Error origin: The file you have downloaded is not marked as executable, so when you pass as inventory file, Ansible tries to read (not to execute it). Ansible tries to read as "ini" file (you have the first warning) but, of course, this is not an ini file so it raises the warning.
Solution: As Dick suggest, you need to mark as executable the script (chmod +x ec2.py) and launch again the ansible command (ansible -i ec2.py all -m ping). Have you tried this solution? El mar., 23 oct. 2018 a las 17:25, <[email protected]> escribió: > HI Dick, thanks for your feedback. I know this docs and the command, but > this command can not work. I want to know the error reason and how I should > do? > > 在 2018年10月23日星期二 UTC+8下午4:15:57,Dick Visser写道: > >> On Tue, 23 Oct 2018 at 09:02, <[email protected]> wrote: >> > >> > HI Kai, thanks for your feedback. I referred to the docs: >> https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html. >> Is it correct? >> >> Yes, it actually says so: >> >> 'The easiest is to use Ansible’s -i command line option and specify >> the path to the script after marking it executable:' >> >> >> Dick >> > -- > 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/0af65ca9-ec45-4b05-b207-603b618c0092%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/0af65ca9-ec45-4b05-b207-603b618c0092%40googlegroups.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 [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/CABN89neAg8QgqnsaYVRAiwhn5OoLk3pFEOvQPBrSj%2B%2B8bT38Lw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
