-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxgds-setup.yml
181 lines (146 loc) · 5.06 KB
/
xgds-setup.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#__END_LICENSE__
- hosts: localhost
vars_prompt:
- name: "xgds_sitename"
prompt: "xGDS site to install"
default: "baseline"
private: no
- name: "user_source_root"
prompt: "Parent directory for source check-out (defaults to $HOME if blank)"
default: null
private: no
- name: "mysql_host"
prompt: "MySQL hostname (keep default 'localhost' to install local MySQL)"
default: "localhost"
private: no
- name: "mysql_user"
prompt: "MySQL remote user ID (use default of 'root' for local install)"
private: no
default: "root"
- name: "db_password"
prompt: "Please enter MySQL database password"
private: yes
confirm: yes
- name: "bing_maps_api_key"
prompt: "Bing maps API key for baselayer map"
private: no
default: ""
- name: "django_superuser"
prompt: "Django adminstrator username"
private: no
default: "xgds"
- name: "django_superuser_password"
prompt: "Django administrator password"
default: "xgds"
private: yes
confirm: yes
- name: "relay_destination_host"
prompt: "Relay destination host"
private: no
default: "localhost"
vars:
source_root: "{{ user_source_root | default(ansible_user_dir, true) }}"
tasks:
# # NOTE: this is temporary until we migrate UI to Bootstrap - Gumby still needs
# # old version of Ruby which we get from Brightbox
# - apt_repository:
# repo: 'ppa:brightbox/ruby-ng'
# become: true
# - name: Update apt cache
# apt: update_cache=true cache_valid_time=86400
# become: true
# Add current user to staff group so they can run migrations in
# dist-packages w/o having to sudo to root.
- user:
name: "{{ ansible_user_id }}"
groups: staff
append: yes
become: true
# Add current user to adm group so they can view log files
# w/o having to sudo to root.
- user:
name: "{{ ansible_user_id }}"
groups: adm
append: yes
become: true
- include_vars: packages/apt-package-list.yml
- name: Install supporting OS packages
apt: pkg={{item}} state=installed
with_items:
- "{{ apt_package_list }}"
become: true
# Another temporary Ruby fix. Be sure alternatives are set to use Ruby 1.9.3
# - name: Set ruby version to 1.9.3
# alternatives:
# name: ruby
# path: /usr/bin/ruby1.9.3
# become: true
- name: Make sure pip is up-to-date
pip: name=pip state=latest
become: true
- include_vars: packages/pip-package-list.yml
- name: Install Python pip packages
command: pip install {{ item }}
with_items:
- "{{ pip_package_list }}"
become: true
- name: Make dist-packages group writable so migrations work later on
file:
path: /usr/local/lib/python2.7/dist-packages
mode: u=rwX,g=rwX,o=rX
recurse: yes
become: true
- include_vars: packages/npm-package-list.yml
- name: Install node NPM packages
npm:
name: "{{ item.name }}"
version: "{{ item.version | default(omit) }}"
state: "{{ item.state | default(omit) }}"
global: true
with_items: "{{ npm_package_list }}"
become: true
- include: mysql/mysql-setup.yml
become: true
- include: apache/apache-setup.yml
become: true
- include: nginx/nginx-setup.yml
become: true
- include: couchdb/couchdb-setup.yml
become: true
- include_vars: packages/gem-package-list.yml
- name: Install Ruby gem packages
gem:
name: "{{ item.name }}"
version: "{{ item.version | default(omit) }}"
state: "{{ item.state | default(omit) }}"
user_install: no
with_items: "{{ gem_package_list }}"
become: true
- stat: path=/home/xgds/.dockersetup
register: docker_setup
# - name: Exit here if in docker setup. Need to check out code in container.
# meta: end_play
# when: docker_setup.stat.exists == True
#
# Last step is to check out the source code and run the django prep scripts
#
- include: code-prep/xgds-checkout.yml
- include: code-prep/xgds-config.yml
- include: code-prep/xgds-3dview-checkout.yml
handlers:
- include: handlers.yml
become: true