Hi stefan, below is the playbook, 

One way is to find a master playbook and include the other playbooks 
whichever is required. suppose if i have 10 microservices and I will have 
10 compose files and as a part of a bug fix I don't need to deploy all of 
them may be 2 or 3 based on the defects. so I thought having 10 different 
play books for 10 compse files and run the required ones.  If you have any 
better idea do suggest me please.

- name: Run a docker compose file
  hosts: dockerVM
  become: yes
  become_method: su

  tasks:
    - set_fact: compose_dir=/root/DockercomposeFile
    - name: create a directory
      file:
        path: "{{compose_dir}}"
        state: directory

    - name: copy docker compose file
      file:
       src: /root/DockerComposeFile
       dest: /root/DockerComposeFile
       mode: "0755"

     - name: Run a docker compose file
       docker_service:
         project_src: "{{ compose_dir }}"
         state: present
       build: no
       register:output

On Saturday, November 2, 2019 at 11:46:20 AM UTC, Stefan Hornburg (Racke) 
wrote:
>
> On 11/2/19 1:28 PM, Sunitha Iyer wrote: 
> > Hi Felix 
> > 
> > Thanks, I am struggling to find the syntax 
>
> Hello Sunitha, 
>
> search for "Ansible docker compose", this should provide enough examples 
> to build upon. 
>
> For specific help, post your playbook and the output and explain why you 
> did it that way. 
>
> Regards 
>         Racke 
>
> > 
> > On Friday, November 1, 2019 at 10:06:04 PM UTC, Felix Fontein wrote: 
> > 
> >     Hi, 
> > 
> >     > Is it possible to run more than one docker compose files from 
> ansible? 
> > 
> >     what makes you think it is not possible? 
> > 
> >     Cheers, 
> >     Felix 
> > 
> > 
> > -- 
> > 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] <javascript:> <mailto:
> [email protected] <javascript:>>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/dd098722-6c01-4f13-8cd2-43d31d6b1505%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/ansible-project/dd098722-6c01-4f13-8cd2-43d31d6b1505%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
>
>
> -- 
> Ecommerce and Linux consulting + Perl and web application programming. 
> Debian and Sympa administration. Provisioning with Ansible. 
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6a395899-7d19-4418-b5e6-b062029fcaa3%40googlegroups.com.

Reply via email to