Readme.md 2.05 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
## Preparation
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
6
### Debian based Linux
Dmitry Volodin's avatar
Dmitry Volodin committed
7
8
9
10
11
12
13
```
#!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
```

Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
14
15
16
17
18
19
20
21
22
### Rhel based Linux
```
#!shell
# yum install python-virtualenv libffi libffi-devel python-devel gcc
# groupadd tower
# useradd -d /home/tower -g tower -s /bin/bash -m tower
```


Dmitry Volodin's avatar
Dmitry Volodin committed
23
24
25
### FreeBSD
```
#!shell
26
# pkg install -y python2 libffi py27-pip py27-virtualenv py27-sqlite3 ca_root_nss
Dmitry Volodin's avatar
Dmitry Volodin committed
27
# pw groupadd -n tower
28
# pw useradd -g tower -s /bin/csh -d /home/tower -n tower -m
Dmitry Volodin's avatar
Dmitry Volodin committed
29
30
31
```


Dmitry Volodin's avatar
Dmitry Volodin committed
32
## Installation
Dmitry Volodin's avatar
Dmitry Volodin committed
33
34
35
36
Tower is installed into /opt/tower directory by default, though you
can use arbitrary directory (i.e. /usr/local/tower) as well.
Replace /opt/tower/ to directory of your choice

Dmitry Volodin's avatar
Dmitry Volodin committed
37
 - Create Tower directory
38
39
40

```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
41
42
# mkdir /opt/tower
# cd /opt/tower
43
```
Dmitry Volodin's avatar
Dmitry Volodin committed
44
45

 - Create virtualenv
46
47
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
48
/opt/tower# virtualenv .
49
```
Dmitry Volodin's avatar
Dmitry Volodin committed
50

Dmitry Volodin's avatar
Dmitry Volodin committed
51
52
53
 - Install Tower
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
54
/opt/tower# ./bin/pip install https://cdn.nocproject.org/tower/noc-tower-latest.tar.bz2
Dmitry Volodin's avatar
Dmitry Volodin committed
55
56
57
/opt/tower# chown -R tower var/
```
 - Generate Tower ssh keys
58
59
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
60
/opt/tower# su - tower -c "ssh-keygen -t rsa -b 4096"
61
```
Dmitry Volodin's avatar
Dmitry Volodin committed
62

Dmitry Volodin's avatar
Dmitry Volodin committed
63
 - Run Tower
64
65
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
66
/opt/tower# su - tower -c "cd /opt/tower && ./bin/tower-web"
67
```
Dmitry Volodin's avatar
Dmitry Volodin committed
68

69
## Deploying
70

Dmitry Volodin's avatar
Dmitry Volodin committed
71
 - Enter the magical mistery tower.
Dmitry Volodin's avatar
Dmitry Volodin committed
72
73
74
75
76
77
78
79
80
81
   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
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
82
83
84
85
86
87
88
89
90
91
On each node 
* create ansible user (*ansible* by default),
* grant it passwordless sudo privileges and copy Tower's
* copy public ssh key (*/home/tower/.ssh/id_rsa.pub*) to *ansible's*
```
#!shell
/opt/tower# su - tower -c "ssh-copy-id node_ip"
```
* For RHEL based systems check if "Defaults    requiretty" is commented.
* Ensure python2.7 package installed