Readme.md 2.09 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
16
17
18
19
20
21
22
### 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
```


Dmitry Volodin's avatar
Dmitry Volodin committed
23
24
## Installation
 - Create Tower directory
25
26
27

```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
28
29
# mkdir /opt/tower
# cd /opt/tower
30
```
Dmitry Volodin's avatar
Dmitry Volodin committed
31
32

 - Create virtualenv
33
34
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
35
/opt/tower# virtualenv .
36
```
Dmitry Volodin's avatar
Dmitry Volodin committed
37

Dmitry Volodin's avatar
Dmitry Volodin committed
38
39
40
 - Install Tower
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
41
/opt/tower# ./bin/pip install https://cdn.nocproject.org/tower/noc-tower-0.1a11.tar.gz
Dmitry Volodin's avatar
Dmitry Volodin committed
42
43
44
/opt/tower# chown -R tower var/
```
 - Generate Tower ssh keys
45
46
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
47
/opt/tower# su - tower -c "ssh-keygen -t rsa -b 4096"
48
```
Dmitry Volodin's avatar
Dmitry Volodin committed
49

Dmitry Volodin's avatar
Dmitry Volodin committed
50
 - Run Tower
51
52
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
53
/opt/tower# su - tower -c "cd /opt/tower && ./bin/tower-web"
54
```
Dmitry Volodin's avatar
Dmitry Volodin committed
55

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## Installation
 - Create Tower directory

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

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

 - Install Tower
```
#!shell
Dmitry Volodin's avatar
Dmitry Volodin committed
74
/usr/local/tower# ./bin/pip install https://cdn.nocproject.org/tower/noc-tower-0.1a13.tar.gz
75
76
77
78
79
/usr/local/tower# chown -R tower var/
```
 - Generate Tower ssh keys
```
#!shell
80
/usr/local/tower# su - tower -c "ssh-keygen -t dsa -b 1024"
81
82
83
84
85
86
87
88
```

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

89
## Deploying
90

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