I'd be interested in seeing something like this. Right now I'm using
docker-machine for some projects, and the way I'm orchestrating
multiple containers on my laptop is Ansible with local raw commands.

I'm sure the Docker folks would tell you that docker-compose is the
way to go here, but for people who are more comfortable with Ansible,
it would be nice to have an alternative.

Of course, if Docker would just put Python in their docker-machine
image, it wouldn't be an issue, but ¯\_(ツ)_/¯

--g

On Sun, Jan 3, 2016 at 5:27 PM, Jonathan Rowlands
<[email protected]> wrote:
> Greetings! I created a primitive suite of docker-machine modules:
>
> https://github.com/jgrowl/ansible-docker-machine
>
> You can create playbooks like:
>
>>> - hosts: 127.0.0.1
>>>
>>>   connection: local
>>>
>>>   tasks:
>>>
>>>   - docker_machine_digitalocean: name={{ item.name }} region={{
>>> item.region }} access_token=ABCDEFGHI private_networking=true state=running
>>>
>>>     with_items:
>>>
>>>       - { name: 'test-east-00', region: 'nyc3' }
>>>
>>>       - { name: 'test-west-00', region: 'sfo1'}
>>>
>>>       - { name: 'test-asia-00', region: 'sgp1'}
>>
>>
> Or a more generic version without any argument_spec checks:
>>
>>   - docker_machine: name=test123 driver=digitalocean region=nyc1
>> access_token=ABCDEFGHI state=running
>
>
>
> Currently the modules don't do much except let you create/destroy machines.
> You can see the logic that all of them use in the module_util:
> https://github.com/jgrowl/ansible-docker-machine/blob/master/module_utils/docker_machine.py
>
> You will also notice that the logic in the module_util use a
> docker-machine-py client that I created specifically for use in these
> ansible modules:
> https://github.com/jgrowl/docker-machine-py
>
> The ansible-docker-machine and docker-machine-py projects are still pretty
> messy and not feature complete. I just wanted to put them out there if
> anyone would find them useful.
> I am also very open to tips, suggestions, etc.
>
> It's not added to the repo yet, but I am also playing around with the idea
> of creating a docker_machine connection plugin that leverages the recent
> docker connection. I am thinking it would work by setting the
> ansible_connection in the hosts file like:
>>
>> [consul_servers]
>> test-east-00  ansible_connection=docker_machine
>
> Maybe an extra 'docker_machine_name' could be specified
>
>
> Again suggestions or constructive criticism is very welcome! Thanks and
> cheers!
>
>
> --
> 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/f805f87d-2802-49a8-8b15-a89196358717%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Greg DeKoenigsberg
Ansible Community Guy

-- 
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/CAM1FbhHaOX38_MPJFa-n4P_FffA%2BARkqmibmnFaOqzezS%2BghEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to