0

Trying to use ansible-container (0.2.0) to create a DB (postgres) container and initialize a database from a pg_dump file. Does ansible-container respect the /docker-entrypoint-initdb.d/? I tried few variations with no luck so wondering if this is officially supported.

techraf
  • 64,883
  • 27
  • 193
  • 198
mistertee
  • 655
  • 1
  • 5
  • 14
  • Check this answer: http://stackoverflow.com/questions/38093801/deploy-ansible-project-which-include-a-docker-compose-yml – helloV Dec 30 '16 at 22:59

1 Answers1

0

Entrypoints are easy with ansible-container, but it's easier still if you are using roles.

In the service definition in container.yml put your entrypoint and command lines:

entrypoint: [/entrypoint.sh]
command: [/usr/bin/dumb-init, /opt/orson/mongo/bin/mongod --config /opt/orson/mongo/conf/mongod.conf]

Put a template of you entrypoint script in the templates folder of your role. Bring the script into your service in the main.yml of your role.

- name: Template entrypoint script
  template: src="entrypoint.sh.j2" dest="/entrypoint.sh" mode=0777