Docker module for `docker-compose run`?

191 views
Skip to first unread message

Brandon Schlueter

unread,
Jan 29, 2018, 3:28:57 PM1/29/18
to Ansible Project
In writing a playbook to bring up sentry according to its docs with docker-compose, I ended up with a task list including:

- name: run database migrations
command:
docker-compose run --rm web upgrade --noinput
chdir=/opt/sentry-onpremise
- name: create initial user
command:
docker-compose run --rm web createuser
--email nob...@example.com
--password supersecretpassword
--superuser
chdir=/opt/sentry-onpremise
- name: start docker service
docker_service:
project_src: /opt/sentry-onpremise
state: present
 
Is there docker module I could be using instead of the command module calls to `docker-compose run`?

For reference, the docker compose file I'm using is at https://github.com/refinery29/sentry-onpremise/blob/master/docker-compose.yml (forked from the original).

Andrew Latham

unread,
Jan 29, 2018, 3:33:14 PM1/29/18
to ansible...@googlegroups.com

--
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+unsubscribe@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/abdd824e-6f43-426c-bdc3-fe0fe1b56b74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
- Andrew "lathama" Latham -

Brandon Schlueter

unread,
Jan 29, 2018, 4:27:11 PM1/29/18
to Ansible Project
I'm aware of that module and am using it in that task list where I would run `docker-compose up`, but I'm not seeing how to use that module for `docker-compose run`, could you elaborate?


On Monday, January 29, 2018 at 3:33:14 PM UTC-5, Andrew Latham wrote:
On Mon, Jan 29, 2018 at 2:28 PM, Brandon Schlueter <b...@bschlueter.com> wrote:
In writing a playbook to bring up sentry according to its docs with docker-compose, I ended up with a task list including:

- name: run database migrations
command:
docker-compose run --rm web upgrade --noinput
chdir=/opt/sentry-onpremise
- name: create initial user
command:
docker-compose run --rm web createuser
--email nob...@example.com
--password supersecretpassword
--superuser
chdir=/opt/sentry-onpremise
- name: start docker service
docker_service:
project_src: /opt/sentry-onpremise
state: present
 
Is there docker module I could be using instead of the command module calls to `docker-compose run`?

For reference, the docker compose file I'm using is at https://github.com/refinery29/sentry-onpremise/blob/master/docker-compose.yml (forked from the original).

--
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.
Reply all
Reply to author
Forward
0 new messages