aadl.docker-nginx-alpine
docker-nginx-alpine
这是一个用于管理和运行 alpine nginx docker 容器的 Ansible 角色。
它基于 marvinpinto/ansible-role-docker-nginx 的版本,但已更新为支持较新的 Ansible(>2.1),并使用 alpine nginx 镜像。
要求
由于这个角色使用了 Ansible 的 docker 模块,您需要确保安装了较新版本的 docker-py
和 docker
。
示例
从 Ansible Galaxy 安装此模块到 './roles' 目录:
ansible-galaxy install aadl.docker-nginx-alpine -p ./roles
在 playbook 中使用,假设您已经设置了 docker:
- hosts: 'servers'
roles:
- role: 'aadl.docker-nginx-alpine'
become: yes
nginx_conf: |
user root;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}
查看 defaults/main.yml,其中包含可以覆盖的角色变量!如果您需要设置 Docker 的 playbook,请查看 marvinpinto.docker Galaxy 角色。
许可证
作者信息
- Marvin Pinto
- Ryan Eby