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

Aleksey Shirokih's avatar
Aleksey Shirokih committed
7
## Install 
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
8

Aleksey Shirokih's avatar
Aleksey Shirokih committed
9
The easiest method of installation and update is to use docker and docker-compose.yml 
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
10

Aleksey Shirokih's avatar
Aleksey Shirokih committed
11
### Docker install
12

13
14
15
#### Install python-pip 
<details>
<summary>CentOS/RHEL </summary>
16

17
<pre><code>
18
19
yum install python-setuptools
easy_install pip
20
21
</code></pre>
</details>
22

23
24
<details>
<summary>Debian/Ubuntu</summary>
25

26
27
28
29
30
31
32
<pre><code>
apt update
apt install --no-install-recommends python-pip curl
</code></pre>
</details>

#### Install docker daemon
Aleksey Shirokih's avatar
Aleksey Shirokih committed
33
34
35
36
```
curl https://get.docker.com | sudo sh 
systemctl start docker 
```
37

38
#### Install docker compose 
39
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
40
41
pip install docker-compose
mkdir /etc/docker-compose/tower -p
Dmitry Volodin's avatar
Dmitry Volodin committed
42
43
```

Aleksey Shirokih's avatar
Aleksey Shirokih committed
44
45
### Setup tower 
Place `docker-compose.yml` from project root to `/etc/docker-compose/tower`
46
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
47
curl https://code.getnoc.com/noc/tower/raw/master/docker-compose.yml > /etc/docker-compose/tower/docker-compose.yml
48
cd /etc/docker-compose/tower
Aleksey Shirokih's avatar
Aleksey Shirokih committed
49
docker-compose up -d 
50
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
51
That it. 
Dmitry Volodin's avatar
Dmitry Volodin committed
52

53
<details>
Aleksey Shirokih's avatar
Aleksey Shirokih committed
54
<summary>Also you can choose the long way of manual installation without docker.</summary>
55
56

<ul dir="auto">
Aleksey Shirokih's avatar
Aleksey Shirokih committed
57
58
59
60
61
<li><a href="docs/Debian.md">Debian</a></li>
<li><a href="docs/CentOS.md">Centos</a></li>
<li><a href="docs/Ubuntu.md">Ubuntu</a></li>
<li><a href="docs/RHEL.md">Red Hat</a></li>
<li><a href="docs/FreeBSD.md">FreeBSD</a></li>
62
63
</ul>
</details>
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
64

Dmitry Volodin's avatar
Dmitry Volodin committed
65

Aleksey Shirokih's avatar
Aleksey Shirokih committed
66
67
68
69
70
## Prepare nodes
On each node 
* double check that python2.7 is installed on nodes
* create ansible user (*ansible* by default),
* grant it passwordless `sudo` privileges and copy Tower's public ssh key (*/opt/tower/var/tower/data/deploy_keys/id_rsa.pub*) to *ansible's*
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
71

72
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
73
/opt/tower# docker-compose exec tower ssh-copy-id -i /opt/tower/var/tower/data/deploy_keys/id_rsa.pub ansible@192.168.1.88
74
```
Dmitry Volodin's avatar
Dmitry Volodin committed
75

76
## Deploying
77

Aleksey Shirokih's avatar
Aleksey Shirokih committed
78
 - Enter noc control tower.
Dmitry Volodin's avatar
Dmitry Volodin committed
79
80
81
82
   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)
83
84
85
86
87
88
89
90
91

## Environment variables used by tower

Several settings can be read from environment variables. 

* `TOWER_RUN_CHECKS=` -- Run ansible checks. On well maintained system there is a way to save some time disabling consistency checks. Valid modes True(default), False.
* `TOWER_SHOW_SECRETS=`  -- Run ansible showing and saving all secret data. Passwords and tokens will be shown and saved to log in that mode. Valid modes False(default), True.
* `TOWER_VERSION=` -- Internal var. Used to check if tower generates inventory well.
* `TOWER_DB_PATH=` -- Internal var. Used to specify `config.db` path