Readme.md 2.52 KB
Newer Older
Dmitry Volodin's avatar
Dmitry Volodin committed
1
2
3
# NOC Tower
NOC Tower is the tool for deployment and maintaining multiple
NOC (http://nocproject.org/) installations.
Aleksey Shirokih's avatar
Aleksey Shirokih committed
4
[![Build Status](https://ci.nocproject.org/job/tower-pipeline/badge/icon)](https://ci.nocproject.org/job/tower-pipeline/)
Dmitry Volodin's avatar
Dmitry Volodin committed
5

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

Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
15
16
17
18
19
20
21
22
23
### 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
24
25
26
### FreeBSD
```
#!shell
27
# pkg install -y python2 libffi py27-pip py27-virtualenv py27-sqlite3 ca_root_nss
Dmitry Volodin's avatar
Dmitry Volodin committed
28
# pw groupadd -n tower
29
# pw useradd -g tower -s /bin/csh -d /home/tower -n tower -m
Dmitry Volodin's avatar
Dmitry Volodin committed
30
31
32
```


Dmitry Volodin's avatar
Dmitry Volodin committed
33
## Installation
Dmitry Volodin's avatar
Dmitry Volodin committed
34
35
36
37
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
38
 - Create Tower directory
39
40
41

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

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

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

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

70
## Deploying
71

Dmitry Volodin's avatar
Dmitry Volodin committed
72
 - Enter the magical mistery tower.
Dmitry Volodin's avatar
Dmitry Volodin committed
73
74
75
76
77
78
79
80
81
82
   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
83
84
85
86
87
88
89
90
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"
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
91
92

## RHEL Only
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
93
94
* For RHEL based systems check if "Defaults    requiretty" is commented.
* Ensure python2.7 package installed
Aleksey Shirokih's avatar
Aleksey Shirokih committed
95
* Create new file on tower in /opt/tower/var/tower/playbooks/ENV_NAME/ansible/vars/local.yml with such lines
Aleksey Shirokih's avatar
fix    
Aleksey Shirokih committed
96

Aleksey Shirokih's avatar
Aleksey Shirokih committed
97
98
99
```
rhel_subscription_username: ""
rhel_subscription_password: ""
Aleksey Shirokih's avatar
fix    
Aleksey Shirokih committed
100
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
101
102
103

## Proxy 
In cause of using proxy for internet acces you should set proxy settings to `/home/tower/.hgrc` that way
Aleksey Shirokih's avatar
fix    
Aleksey Shirokih committed
104

Aleksey Shirokih's avatar
Aleksey Shirokih committed
105
106
107
108
```
[http_proxy]
host=192.168.1.1:3128
```