Git Product home page Git Product logo

ansible-role-docker_deployment's Introduction

Ansible Role: docker_deployment

Deploy your docker images.

https://www.docker.com/

Role Variables

registry_type: aws-ecr

The registry type.

Posible values:

  • aws-ecr
  • self-hosted (like nexus docker registry or docker offical registry)
  • archive-tar (docker save tar file)
  • dockerhub (self-hosted), you can set registry_url to registry.hub.docker.com and set team to library if the image is official support.
registry_region: us-west-1

Region of AWS ECR, only required in registry_type=aws-ecr

aws_access_key_id: "{{ lookup('env', 'AWS_ACCESS_KEY_ID') }}"

Access-Key-Id of AWS IAM, please set an environment AWS_ACCESS_KEY_ID, only required in registry_type=aws-ecr

aws_secret_access_key: "{{ lookup('env', 'AWS_SECRET_ACCESS_KEY') }}"

Secret-Access-Key of AWS IAM, please set an environment AWS_SECRET_ACCESS_KEY, only required in registry_type=aws-ecr

registry_username: "{{ lookup('env', 'REGISTRY_USERNAME') }}"

Username of registry, please set an environment REGISTRY_USERNAME, only required in registry_type=self-hosted

registry_password: "{{ lookup('env', 'REGISTRY_PASSWORD') }}"

Password of registry, please set an environment REGISTRY_PASSWORD, only required in registry_type=self-hosted

archive_username: "{{ lookup('env', 'ARCHIVE_USERNAME') }}"

Username of archive url, please set an environment ARCHIVE_USERNAME, only required in archive_type=archive-tar

archive_password: "{{ lookup('env', 'ARCHIVE_PASSWORD') }}"

Password of archive url, please set an environment ARCHIVE_PASSWORD, only required in registry_type=archive-tar

archive_url: "{{ lookip('env', 'ARCHIVE_URL') }}"

Url of archive server, without archive tar.gz file name, please set an environment ARCHIVE_URL, only required in registry_type=archive-tar

registry_scheme: https

Scheme type of registry

Posible values:

  • https (default)
  • http
registry_url: dockerhub.com

Docker registry url

image_team: moa

Team name of the image owned.

image_project: caddy

Project name of the image.

image_tag: latest

Tag of image to deploy

container_name: caddy-server-1

Name of the container

container_ports: []

Port to expose

container_restart_policy: always

Restart policy of container

container_environment: {}

Environment of container, dictionary of key,value pairs.

container_env_file: ''

Path to a file, present on the target, containing environment variables FOO=BAR.

container_volumes: []

Mounted volumes of container

container_extra_hosts:

Add hostname mappings. Use the same values as the docker client --add-host parameter.

container_command: ''

Command to run

Sees: (https://docs.docker.com/compose/compose-file/#command)[https://docs.docker.com/compose/compose-file/#command]

container_privileged: no

Give extended privileges to this container

container_dns_servers: []

List of custom DNS servers.

container_dns_search_domains: []

List of custom DNS search domains.

container_network_mode: ''

Connect the container to a network. Choices are "bridge", "host", "none" or "container:<name|id>".

container_capabilities: []

List of capabilities to add to the container.

container_log_driver: json-file

The container can have a different logging driver than the Docker daemon. Choices are "none", "json-file", "syslog", "journald", "gelf", "fluentd", "awslogs", "splunk"

container_log_options:

Example Playbook

- hosts: server
  vars:
    registry_url: dockerhub.com
    image_team: moa
    image_project: caddy
    image_tag: latest
    container_name: caddy-server-01
    container_ports:
      - 80:80
      - 443:443
    container_restart_policy: always
    container_environment:
      HOST_ID: 100
    container_env_file: xxx.env
    container_volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
      - ${PWD}/data:/data
    container_privileged: no
    container_network_mode: 'bridge'
    container_capabilities: 
      - NET_ADMIN
    container_log_driver: json-file
    container_log_options:
      max-size: 10m
      max-file: 3
  roles:
    - { role: honomoa.docker_deployment }

License

CC BY-SA 3.0

ansible-role-docker_deployment's People

Contributors

honomoa avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.