On 22 February 2014 14:25, Aaron Hunter <[email protected]> wrote:
> I often want to create and share stand-alone, single plays (i.e.,
> some_task.yml). Ansible makes it very easy to automate tedious admin tasks
> so I like to use it instead of old-school shell scripting. This works fine
> of course but there is one small friction point in the form of the
> inventory file. It would be cool if I could run a stand-alone play without
> an inventory file (the host is already in the play) just be typing
> 'ansible-playbook some_task.yml'
That will never be possible with just as task file, bit given you have a
minimal playbook containing
- hosts: all
tasks:
- name: some task
action: ...
there is a trick to do just that;
ansible-playbook all -i my.one.off.host.name, play.yml
Note the trailing comma at the end of the inventory.
Serge
--
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/CAEhzMJC-zrTggMgD%3D0B5_J4r6LFcnptZ6jeqfA2Cz8Tr23E43Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.