aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/heat/tasks/heat_install.yml
diff options
context:
space:
mode:
authorliyuenan <liyuenan@huawei.com>2017-01-18 18:05:27 +0800
committerliyuenan <liyuenan@huawei.com>2017-01-25 12:37:20 +0800
commit7173757a6190f4528d36053d82467c74dbf16b3f (patch)
treebfed2b845188bf51891f6397b3fbd3afbd566fea /deploy/adapters/ansible/roles/heat/tasks/heat_install.yml
parentd001a27936a5d55cda2d8ca0849f30a8bd1c0b3d (diff)
Ansible Module substitute for Shell Commands
JIRA: COMPASS-520 After update ansible version to v3, keystone_user module only support v2 API. So we use Shell Commands now, but it will failed with high probability. Those Shell Commands should be instead by ansible modules to manage Identity users, projects or some other work like crate networks. Change-Id: I63d38b4a811a9c063ac4404da72787f594411b53 Signed-off-by: liyuenan <liyuenan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/heat/tasks/heat_install.yml')
-rw-r--r--deploy/adapters/ansible/roles/heat/tasks/heat_install.yml38
1 files changed, 28 insertions, 10 deletions
diff --git a/deploy/adapters/ansible/roles/heat/tasks/heat_install.yml b/deploy/adapters/ansible/roles/heat/tasks/heat_install.yml
index fd0f6eaa..2803a3e6 100644
--- a/deploy/adapters/ansible/roles/heat/tasks/heat_install.yml
+++ b/deploy/adapters/ansible/roles/heat/tasks/heat_install.yml
@@ -17,16 +17,34 @@
lineinfile: dest=/opt/service create=yes line='{{ item }}'
with_items: "{{ services | union(services_noarch) }}"
-- name: create heat user domain
- shell: |
- . /opt/admin-openrc.sh;
- openstack domain create --description "Stack projects and users" heat;
- openstack user create --domain heat --password {{ HEAT_PASS }} \
- heat_domain_admin;
- openstack role add --domain heat --user-domain heat \
- --user heat_domain_admin admin;
- openstack role create heat_stack_owner;
- openstack role add --project demo --user demo heat_stack_owner;
+- name: create heat domain
+ os_keystone_domain:
+ cloud: opnfv
+ name: heat
+ state: present
+ description: "Stack projects and users"
+ when: inventory_hostname == groups['controller'][0]
+
+- name: create heat user
+ os_user:
+ cloud: opnfv
+ domain: heat
+ name: heat_domain_user
+ password: "{{ HEAT_PASS }}"
+ when: inventory_hostname == groups['controller'][0]
+
+- name: create heat role
+ os_keystone_role:
+ cloud: opnfv
+ name: heat_stack_owner
+ when: inventory_hostname == groups['controller'][0]
+
+- name: grant heat role
+ os_user_role:
+ cloud: opnfv
+ user: demo
+ project: demo
+ role: heat_stack_owner
when: inventory_hostname == groups['controller'][0]
- name: update heat conf