[WIP]ansible: add senlin v1.0 deploy#61
Conversation
|
先不急着合并,等多部署几次没有问题,在合并. |
| - Restart senlin-api container | ||
| - Restart senlin-engine container | ||
|
|
||
| senlin_haproxy_order: "301" |
There was a problem hiding this comment.
这里应该多余了,在 ansible/roles/haproxy/defaults/main.yml 里已经定义过了。
|
|
||
| senlin_haproxy_order: "301" | ||
|
|
||
| senlin_managed_tenant: "senlin-managed-tenant" |
There was a problem hiding this comment.
senlin 也需要一个单独的 tenant 吗?
| @@ -0,0 +1,39 @@ | |||
|
|
|||
There was a problem hiding this comment.
这个文件应该直接放到 Docker image 吧?
因为整个 /etc/senlin 都是从 host 映射到 container 的,所以直接放到 Image 里,会被掩盖。
There was a problem hiding this comment.
测试了一下放在Docker image里面,发现服务启动的时候不能加载这个文件.
日志中提示"ERROR: Unable to locate config file", 不知道是不是与容器存储的路径有关,现在还没有确认.
| @@ -0,0 +1,50 @@ | |||
| { | |||
There was a problem hiding this comment.
这个和 ansible/roles/senlin/files/api-paste.ini 类似,可以直接放进 Docker image。
参见 ansible/roles/senlin/files/api-paste.ini 的更新评论。
| restart_policy: "{{ docker_restart_policy }}" | ||
| when: senlin_conf.changed | bool | ||
| or senlin_engine_container.changed | bool | ||
| or (senlin_database_migrate is defined and senlin_database_migrate.rc == 0) |
There was a problem hiding this comment.
不太确定这里存不存在 senlin_database_migrate.rc == 0 ?
不过正常应该是, database migrate 如果执行的话都应该成功,不成功的话 ansible-playbook 应该会中止退出。所以直接判断 senlin_database_migrate.changed 应该就可以。
| state: "directory" | ||
| owner: senlin | ||
|
|
||
| - name: Copy api-paste.ini |
There was a problem hiding this comment.
参见关于 ansible/roles/senlin/files/api-paste.ini 的评论。
| src: api-paste.ini | ||
| dest: "{{ eayunstack_config_base }}/{{ project_name }}/" | ||
|
|
||
| - name: Copy policy.json |
There was a problem hiding this comment.
参见关于 ansible/roles/senlin/files/policy.json 的评论。
ansible/roles/senlin/tasks/main.yml
Outdated
| @@ -0,0 +1,64 @@ | |||
| - name: ensure senlin tenant, user | |||
There was a problem hiding this comment.
这里需要确认 senlin 是否需要单独的 tenant 和 user 。
There was a problem hiding this comment.
这里没有建 tenant 的话, task 名称可以改下,比如 “ensure senlin user, service” 之类?
ansible/roles/senlin/tasks/main.yml
Outdated
| service_type: "clustering" | ||
| endpoint_dict: "{{ senlin_endpoints }}" | ||
|
|
||
| - name: get id of senlin-managed-tenant |
There was a problem hiding this comment.
参见其它相关的评论,这个 senlin-managed-tenant 看起来不需要?
ansible/roles/senlin/tasks/pull.yml
Outdated
| image: "{{ item.value.image }}" | ||
| with_dict: "{{ senlin_services }}" | ||
|
|
||
| - name: Pulling senlin database migration image |
There was a problem hiding this comment.
如果只用一个 senlin_base image 的话, database migrate 这个操作也可以使用一个 image 完成,不用 pull 两次。
ae57afc to
46f298e
Compare
46f298e to
a41ff4c
Compare
|
#65 已经 merge ,senlin 也要调一下新加的 handler 。 |
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
a41ff4c to
4abcf42
Compare
|
@fabian4 不着急合并的标题头部可以加上 |
Signed-off-by: Yuanbin.Chen cybing4@gmail.com