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

Aleksey Shirokih's avatar
Aleksey Shirokih committed
5
[![build status](https://code.getnoc.com/noc/tower/badges/master/build.svg)](https://code.getnoc.com/noc/tower/commits/master)
Dmitry Volodin's avatar
Dmitry Volodin committed
6

Dmitry Volodin's avatar
Dmitry Volodin committed
7
## Preparation
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
8
### Debian based Linux
Dmitry Volodin's avatar
Dmitry Volodin committed
9
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
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
```

15
16
## Debian only
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
17
18
19

/opt/tower# apt-get install dbus git
/opt/tower# apt install --no-install-recommends git
20
21
```

Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
22
23
### Rhel based Linux
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
24
# yum install python-virtualenv libffi libffi-devel python-devel gcc openssl-devel git libselinux-python
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
25
26
# groupadd tower
# useradd -d /home/tower -g tower -s /bin/bash -m tower
ezombie's avatar
ezombie committed
27

Aleksey Shirokih's avatar
Aleksey Shirokih committed
28
You have to check if 'SELINUX=disabled' in /etc/sysconfig/selinux and reboot system after changes
29
30
31

# firewall-cmd --add-port 8888/tcp --permanent
# firewall-cmd --reload 
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
32
33
34
```


Dmitry Volodin's avatar
Dmitry Volodin committed
35
36
### FreeBSD
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
37
# pkg install -y python2 libffi py27-pip py27-virtualenv py27-sqlite3 ca_root_nss git
Dmitry Volodin's avatar
Dmitry Volodin committed
38
# pw groupadd -n tower
39
# pw useradd -g tower -s /bin/csh -d /home/tower -n tower -m
Dmitry Volodin's avatar
Dmitry Volodin committed
40
41
42
```


Dmitry Volodin's avatar
Dmitry Volodin committed
43
## Installation
Dmitry Volodin's avatar
Dmitry Volodin committed
44
45
46
47
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
48
 - Create Tower directory
49
50

```
Dmitry Volodin's avatar
Dmitry Volodin committed
51
52
# mkdir /opt/tower
# cd /opt/tower
53
```
Dmitry Volodin's avatar
Dmitry Volodin committed
54
55

 - Create virtualenv
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
56

57
```
Dmitry Volodin's avatar
Dmitry Volodin committed
58
/opt/tower# virtualenv .
59
```
Dmitry Volodin's avatar
Dmitry Volodin committed
60

Dmitry Volodin's avatar
Dmitry Volodin committed
61
 - Install Tower
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
62

Dmitry Volodin's avatar
Dmitry Volodin committed
63
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
64
/opt/tower# ./bin/pip install --upgrade pip
Aleksey Shirokih's avatar
Aleksey Shirokih committed
65
/opt/tower# ./bin/pip install https://cdn.getnoc.com/tower/noc-tower-latest.zip
Dmitry Volodin's avatar
Dmitry Volodin committed
66
67
68
/opt/tower# chown -R tower var/
```
 - Generate Tower ssh keys
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
69

70
```
Dmitry Volodin's avatar
Dmitry Volodin committed
71
/opt/tower# su - tower -c "ssh-keygen -t rsa -b 4096"
72
```
Dmitry Volodin's avatar
Dmitry Volodin committed
73

Aleksey Shirokih's avatar
Aleksey Shirokih committed
74
75
76
77
## For single node installation only
Add user tower to sudo group.
* For example: `adduser tower sudo`
* Select Local installation type with local ip on Nodes screen. 
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
78
* Run Tower
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
79

80
```
Dmitry Volodin's avatar
Dmitry Volodin committed
81
/opt/tower# su - tower -c "cd /opt/tower && ./bin/tower-web"
82
```
Dmitry Volodin's avatar
Dmitry Volodin committed
83

84
## Deploying
85

Dmitry Volodin's avatar
Dmitry Volodin committed
86
 - Enter the magical mistery tower.
Dmitry Volodin's avatar
Dmitry Volodin committed
87
88
89
90
91
92
   Open http://<IP>:8888/ in your browser. Login as admin/admin

 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
93
94
On each node 
* create ansible user (*ansible* by default),
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
95
96
* grant it passwordless `sudo` privileges and copy Tower's public ssh key (*/home/tower/.ssh/id_rsa.pub*) to *ansible's*

Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
97
98
99
```
/opt/tower# su - tower -c "ssh-copy-id node_ip"
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
100
101

## RHEL Only
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
102
103
* For RHEL based systems check if "Defaults    requiretty" is commented.
* Ensure python2.7 package installed
Aleksey Shirokih's avatar
Aleksey Shirokih committed
104
* 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
105

Aleksey Shirokih's avatar
Aleksey Shirokih committed
106
107
108
```
rhel_subscription_username: ""
rhel_subscription_password: ""
Aleksey Shirokih's avatar
Aleksey Shirokih committed
109
```