Skip to content

[WIP]ansible: add senlin v1.0 deploy#61

Open
Farice4 wants to merge 1 commit into
eayunstack:masterfrom
Farice4:add-senlin-deploy
Open

[WIP]ansible: add senlin v1.0 deploy#61
Farice4 wants to merge 1 commit into
eayunstack:masterfrom
Farice4:add-senlin-deploy

Conversation

@Farice4

@Farice4 Farice4 commented Jul 10, 2017

Copy link
Copy Markdown
Contributor

Signed-off-by: Yuanbin.Chen cybing4@gmail.com

@Farice4

Farice4 commented Jul 10, 2017

Copy link
Copy Markdown
Contributor Author

先不急着合并,等多部署几次没有问题,在合并.

Comment thread ansible/roles/senlin/defaults/main.yml Outdated
- Restart senlin-api container
- Restart senlin-engine container

senlin_haproxy_order: "301"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该多余了,在 ansible/roles/haproxy/defaults/main.yml 里已经定义过了。

Comment thread ansible/roles/senlin/defaults/main.yml Outdated

senlin_haproxy_order: "301"

senlin_managed_tenant: "senlin-managed-tenant"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

senlin 也需要一个单独的 tenant 吗?

@@ -0,0 +1,39 @@

@zhaochao zhaochao Jul 11, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件应该直接放到 Docker image 吧?

因为整个 /etc/senlin 都是从 host 映射到 container 的,所以直接放到 Image 里,会被掩盖。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试了一下放在Docker image里面,发现服务启动的时候不能加载这个文件.

日志中提示"ERROR: Unable to locate config file", 不知道是不是与容器存储的路径有关,现在还没有确认.

@@ -0,0 +1,50 @@
{

@zhaochao zhaochao Jul 11, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个和 ansible/roles/senlin/files/api-paste.ini 类似,可以直接放进 Docker image。

参见 ansible/roles/senlin/files/api-paste.ini 的更新评论。

Comment thread ansible/roles/senlin/handlers/main.yml Outdated
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不太确定这里存不存在 senlin_database_migrate.rc == 0 ?

不过正常应该是, database migrate 如果执行的话都应该成功,不成功的话 ansible-playbook 应该会中止退出。所以直接判断 senlin_database_migrate.changed 应该就可以。

state: "directory"
owner: senlin

- name: Copy api-paste.ini

@zhaochao zhaochao Jul 11, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参见关于 ansible/roles/senlin/files/api-paste.ini 的评论。

src: api-paste.ini
dest: "{{ eayunstack_config_base }}/{{ project_name }}/"

- name: Copy policy.json

@zhaochao zhaochao Jul 11, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参见关于 ansible/roles/senlin/files/policy.json 的评论。

Comment thread ansible/roles/senlin/tasks/main.yml Outdated
@@ -0,0 +1,64 @@
- name: ensure senlin tenant, user

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里需要确认 senlin 是否需要单独的 tenant 和 user 。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里没有建 tenant 的话, task 名称可以改下,比如 “ensure senlin user, service” 之类?

Comment thread ansible/roles/senlin/tasks/main.yml Outdated
service_type: "clustering"
endpoint_dict: "{{ senlin_endpoints }}"

- name: get id of senlin-managed-tenant

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参见其它相关的评论,这个 senlin-managed-tenant 看起来不需要?

Comment thread ansible/roles/senlin/tasks/pull.yml Outdated
image: "{{ item.value.image }}"
with_dict: "{{ senlin_services }}"

- name: Pulling senlin database migration image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果只用一个 senlin_base image 的话, database migrate 这个操作也可以使用一个 image 完成,不用 pull 两次。

@Farice4 Farice4 force-pushed the add-senlin-deploy branch from ae57afc to 46f298e Compare July 12, 2017 10:34
@Farice4 Farice4 force-pushed the add-senlin-deploy branch from 46f298e to a41ff4c Compare July 25, 2017 04:28
@zhaochao

zhaochao commented Aug 4, 2017

Copy link
Copy Markdown
Contributor

#65 已经 merge ,senlin 也要调一下新加的 handler 。

Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
@Farice4 Farice4 force-pushed the add-senlin-deploy branch from a41ff4c to 4abcf42 Compare August 7, 2017 01:29
@blkart

blkart commented Aug 9, 2017

Copy link
Copy Markdown
Contributor

@fabian4 不着急合并的标题头部可以加上 WIP:

@Farice4 Farice4 changed the title ansible: add senlin v1.0 deploy [WIP]ansible: add senlin v1.0 deploy Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants