Readme.md 2.08 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

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
### FreeBSD
```
#!shell
# pkg install -y python2 libffi py27-pip py27-virtualenv py27-sqlite ca_root_nss
# pw groupadd -n tower
# pw useradd -g tower -s /bin/sh -d /home/tower -n tower -m
```

## Installation
 - Create Tower directory

```
#!shell
# mkdir /usr/local/tower
# cd /usr/local/tower
```

 - Create virtualenv
```
#!shell
/usr/local/tower# virtualenv .
```

 - Install Tower
```
#!shell
/usr/local/tower# ./bin/pip install https://cdn.nocproject.org/tower/noc-tower-0.1a10.tar.gz
/usr/local/tower# chown -R tower var/
```
 - Generate Tower ssh keys
```
#!shell
/usr/local/tower# su - tower -c "ssh-keygen -t rsa -b 4096"
```

 - Run Tower
```
#!shell
/usr/local/tower# su - tower -c "cd /usr/local/tower && ./bin/tower-web"
```



Dmitry Volodin's avatar
Dmitry Volodin committed
90
 - Enter the magical mistery tower.
Dmitry Volodin's avatar
Dmitry Volodin committed
91
92
93
94
95
96
97
98
99
100
101
102
103
   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*
104
*authorized_keys* (*/home/ansible/.ssh/authorized_keys*)