-
Notifications
You must be signed in to change notification settings - Fork 0
/
keystone.yml
78 lines (63 loc) · 2.73 KB
/
keystone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#---
# - hosts: openstack
# remote_user: root
# gather_facts: True
#
# tasks:
- name: create database
mysql_db: name=keystone state=present
- name: create user
mysql_user: name=keystone password=keystone123 priv='keystone.*:ALL,GRANT' host={{ item }}
with_items:
- localhost
- '%'
- xopenstack
- name: "Install Keystone"
yum: name={{ item }} enablerepo=centos-openstack-ocata,epel state=present
with_items:
- openstack-keystone
- openstack-utils
- python-openstackclient
- httpd
- mod_wsgi
- name: "Keystone configuration"
lineinfile: dest=/etc/keystone/keystone.conf
line={{ item.line }}
insertafter={{ item.insertafter }}
with_items:
- { line: "connection = mysql+pymysql://keystone:keystone123@{{ ansible_host }}/keystone", insertafter: "^#?connection = <None>" }
- { line: "servers = {{ ansible_host }}:11211", insertafter: '^\[memcache\]' }
- { line: "driver = memcache", insertafter: '^\[token\]' }
- { line: "provider = fernet", insertafter: '^\[token\]' }
- name: "keystone DB-Syn"
shell: keystone-manage db_sync
become: true
become_method: su
become_user: keystone
become_flags: '-s /bin/bash'
- name: "keystone manage"
shell: "{{ item }}"
args:
executable: /bin/bash
with_items:
- keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
- keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
- keystone-manage bootstrap --bootstrap-password adminpassword --bootstrap-admin-url http://{{ ansible_host }}:35357/v3/ --bootstrap-internal-url http://{{ ansible_host }}:35357/v3/ --bootstrap-public-url http://{{ ansible_host }}:5000/v3/ --bootstrap-region-id RegionOne
- name: "Enableconfig for Keystone ans start Apache httpd"
shell: ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
- name: "start and enable apache"
service: name=httpd state=started enabled=yes
- name: "keystonerc"
copy: src=keystonerc dest=~/keystonerc mode=600
- name: "replace ansible_host"
replace: dest=~/keystonerc regexp='192.168.122.18' replace={{ ansible_host }} backup=yes
- name: "Create projectss"
shell: . ~/keystonerc && {{ item }}
args:
executable: /bin/bash
register: projects
with_items:
- openstack project create --domain default --description "Service Project" service
- openstack service list
- openstack project list
- debug: var=projects