Readme.md 1.35 KB
Newer Older
Dmitry Volodin's avatar
Dmitry Volodin committed
1
2
3
4
# NOC Tower
NOC Tower is the tool for deployment and maintaining multiple
NOC (http://nocproject.org/) installations.

Dmitry Volodin's avatar
Dmitry Volodin committed
5
6
7
8
9
10
11
12
13
## Preparation
### Debian
```
#!shell
# apt-get install python-virtualenv libffi6 libffi-dev python-dev gcc
# groupadd tower
# useradd -d /home/tower -g tower -s /bin/bash -m tower
```

Dmitry Volodin's avatar
Dmitry Volodin committed
14
15
## Installation
 - Create Tower directory
16
17
18

```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
19
20
# mkdir /opt/tower
# cd /opt/tower
21
```
Dmitry Volodin's avatar
Dmitry Volodin committed
22
23

 - Create virtualenv
24
25
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
26
/opt/tower# virtualenv .
27
```
Dmitry Volodin's avatar
Dmitry Volodin committed
28

Dmitry Volodin's avatar
Dmitry Volodin committed
29
30
31
 - Install Tower
```
#!shell
32
/opt/tower# ./bin/pip install https://cdn.nocproject.org/tower/noc-tower-0.1a10.tar.gz
Dmitry Volodin's avatar
Dmitry Volodin committed
33
34
35
/opt/tower# chown -R tower var/
```
 - Generate Tower ssh keys
36
37
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
38
/opt/tower# su - tower -c "ssh-keygen -t rsa -b 4096"
39
```
Dmitry Volodin's avatar
Dmitry Volodin committed
40

Dmitry Volodin's avatar
Dmitry Volodin committed
41
 - Run Tower
42
43
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
44
/opt/tower# su - tower -c "cd /opt/tower && ./bin/tower-web"
45
```
Dmitry Volodin's avatar
Dmitry Volodin committed
46

Dmitry Volodin's avatar
Dmitry Volodin committed
47
 - Enter the magical mistery tower.
Dmitry Volodin's avatar
Dmitry Volodin committed
48
49
50
51
52
53
54
55
56
57
58
59
60
   Open http://<IP>:8888/ in your browser. Login as admin/admin

 - Set up Tower
 Go to settings and set Tower's site URL (http://<IP>:8888/) and
 Tower's repository URL, as seen by nodes (http://<IP>:8888/hg).

 Do not forget to change tower's admin password
 (Upper right menu > Change Password)

## Prepare nodes
On each node create ansible user (*ansible* by default),
grant it passwordless sudo privileges and copy Tower's
public ssh key (/home/tower/.ssh/id_rsa.pub) to *ansible's*
61
*authorized_keys* (*/home/ansible/.ssh/authorized_keys*)