-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.yaml
97 lines (87 loc) · 2.05 KB
/
main.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
- name: install apt packages
apt:
pkg={{ item }}
update_cache=yes
cache_valid_time=600
with_items:
- git
- libffi-dev
- libssl-dev
- python-dev
- name: checkout source code
git:
repo=https://review.openstack.org/openstack/{{ item.repo }}.git
dest=/opt/{{ item.repo }}
force=yes
refspec={{ item.version }}
with_items:
- { repo: 'keystone', version: "{{ keystone_version | default('refs/heads/master') }}" }
- { repo: 'python-keystoneclient', version: "{{ keystoneclient_version | default('refs/heads/master') }}" }
- { repo: 'keystoneauth', version: "{{ keystoneauth_version | default('refs/heads/master') }}" }
- name: establish a configuration directory for keystone
file:
path=/etc/keystone
state=directory
owner=www-data
group=www-data
mode=0755
- name: create dirs for wsgi scripts
file:
path=/var/{{ item }}
state=directory
owner=www-data
group=www-data
mode=0755
with_items:
- keystone
- name: deploy keystone wsgi scripts
template:
src=keystone.wsgi
dest=/var/keystone/{{ item }}
owner=www-data
group=www-data
mode=0400
with_items:
- admin
- main
- name: deploy keystone configuration files
template:
src={{ item }}
dest=/etc/keystone/{{ item }}
owner=www-data
group=www-data
mode=0400
with_items:
- keystone.conf
- paste.ini
- policy.json
- name: install extra python requirements
pip:
name={{ item }}
state=latest
with_items:
- pycrypto
- python-memcached
- six # workaround for debian wheezy?
- name: install python projects
pip:
name=/opt/{{ item }}
state=present
extra_args="-e"
with_items:
- keystone
- python-keystoneclient
- keystoneauth
- name: run database migrations
command: keystone-manage db_sync
- name: test if apache is installed
command: which apache2
register: apache_installed
ignore_errors: true
tags:
- config
- name: configure apache
include: apache.yaml
when: apache_installed.rc == 0
tags:
- config