Answers for "run docker container with ansible"

0

run docker container with ansible

# In playbook, use docker_container module

- hosts: database1
  tasks:
  - name: Start docker service
      service: 
        name: docker
        state: started
   - name: Create Postgres Container 
      docker_container: # HERE the module
        name: postgres
        image: postgres:12
        state: started
        recreate: yes # Defines if an existing container should be recreated
        ports: 
          - "5432:5432"
        volumes: 
          - /home/my_volume:/var/lib/postgresql/data
        env:
        	myenv1: ""
Posted by: Guest on February-24-2021

Code answers related to "run docker container with ansible"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language