Re: [ansible-project] Run Ansible Playbook inside Docker container?
I hadn't thought of using Ansible to create Docker images before, but this is an interesting way to do this, instead of using a complicated Dockerfile to manage each variety of service. I might want to figure out a way to be able to build an image for each group in your hosts file. On Tuesday, June 30, 2015 at 1:26:02 AM UTC-4, Erik wrote: > > Sure, the general pattern I follow is thus: > > 1. I use a base docker image that already has ansible installed. > 2. In your Dockerfile, use the COPY command to copy your ansible files > (playbook yaml, files, etc.) into the container. Something like: > > COPY ansible/ /tmp/ansible/ > > 3. After the copy, in your Dockerfile, run ansible-playbook on the > files you copied into the container in the previous step: > > RUN ansible-playbook /tmp/ansible/foo.yml -i /tmp/ansible/hosts > > In this case, /tmp/ansible/hosts just contains: > > [local] > 127.0.0.1 > > And in the playbook, I specify: > > - hosts: local > connection: local > > 4. After the playbook completes, remove the ansible files you copied > in during step 2. > > On Mon, Jun 29, 2015 at 6:10 PM, Alejandro Ferrari > wrote: > > Hi All, > > > > I like to know if someone is using Ansible to provisioning inside a > Docker > > container... and how use this? > > > > I has all my infrastructure in Playbooks, now l like to use this to > create > > Dockers for each of my microservices... but I can't found some > > alternatives... > > > > As we know Ansible use SSH but de best practice of Docker is NOT use SSH > to > > login into container... for this reason my doubt... > > > > Some idea or advices about how use this? > > > > Thanks > > Alejandro > > > > -- > > 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-proje...@googlegroups.com . > > To post to this group, send email to ansible...@googlegroups.com > . > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/ansible-project/eb3bbdb6-f34e-48c8-af70-2f34819f0a52%40googlegroups.com. > > > > 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/dc44acdb-8da6-4288-945a-9aefce1b1228%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Run Ansible Playbook inside Docker container?
Thank you! This got me up and going fast. On Monday, June 29, 2015 at 10:26:02 PM UTC-7, Erik wrote: > > Sure, the general pattern I follow is thus: > > 1. I use a base docker image that already has ansible installed. > 2. In your Dockerfile, use the COPY command to copy your ansible files > (playbook yaml, files, etc.) into the container. Something like: > > COPY ansible/ /tmp/ansible/ > > 3. After the copy, in your Dockerfile, run ansible-playbook on the > files you copied into the container in the previous step: > > RUN ansible-playbook /tmp/ansible/foo.yml -i /tmp/ansible/hosts > > In this case, /tmp/ansible/hosts just contains: > > [local] > 127.0.0.1 > > And in the playbook, I specify: > > - hosts: local > connection: local > > 4. After the playbook completes, remove the ansible files you copied > in during step 2. > > On Mon, Jun 29, 2015 at 6:10 PM, Alejandro Ferrari > wrote: > > Hi All, > > > > I like to know if someone is using Ansible to provisioning inside a > Docker > > container... and how use this? > > > > I has all my infrastructure in Playbooks, now l like to use this to > create > > Dockers for each of my microservices... but I can't found some > > alternatives... > > > > As we know Ansible use SSH but de best practice of Docker is NOT use SSH > to > > login into container... for this reason my doubt... > > > > Some idea or advices about how use this? > > > > Thanks > > Alejandro > > > > -- > > 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-proje...@googlegroups.com . > > To post to this group, send email to ansible...@googlegroups.com > . > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/ansible-project/eb3bbdb6-f34e-48c8-af70-2f34819f0a52%40googlegroups.com. > > > > 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/3ba46c66-e875-4757-8051-47abc3d26a6c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Run Ansible Playbook inside Docker container?
Sure, the general pattern I follow is thus: 1. I use a base docker image that already has ansible installed. 2. In your Dockerfile, use the COPY command to copy your ansible files (playbook yaml, files, etc.) into the container. Something like: COPY ansible/ /tmp/ansible/ 3. After the copy, in your Dockerfile, run ansible-playbook on the files you copied into the container in the previous step: RUN ansible-playbook /tmp/ansible/foo.yml -i /tmp/ansible/hosts In this case, /tmp/ansible/hosts just contains: [local] 127.0.0.1 And in the playbook, I specify: - hosts: local connection: local 4. After the playbook completes, remove the ansible files you copied in during step 2. On Mon, Jun 29, 2015 at 6:10 PM, Alejandro Ferrari wrote: > Hi All, > > I like to know if someone is using Ansible to provisioning inside a Docker > container... and how use this? > > I has all my infrastructure in Playbooks, now l like to use this to create > Dockers for each of my microservices... but I can't found some > alternatives... > > As we know Ansible use SSH but de best practice of Docker is NOT use SSH to > login into container... for this reason my doubt... > > Some idea or advices about how use this? > > Thanks > Alejandro > > -- > 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/eb3bbdb6-f34e-48c8-af70-2f34819f0a52%40googlegroups.com. > 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/CADdM08q%2BsTF2ZNyk7u6AMfXZSa-J7cbH%3Dq4ykBFPVE_FFRwUUw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Run Ansible Playbook inside Docker container?
Hi All, I like to know if someone is using Ansible to provisioning inside a Docker container... and how use this? I has all my infrastructure in Playbooks, now l like to use this to create Dockers for each of my microservices... but I can't found some alternatives... As we know Ansible use SSH but de best practice of Docker is NOT use SSH to login into container... for this reason my doubt... Some idea or advices about how use this? Thanks Alejandro -- 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/eb3bbdb6-f34e-48c8-af70-2f34819f0a52%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.