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

EKbfh's avatar
EKbfh committed
7
8
9
10
11
12
13
14
15
16
17
18
## 100% Supported OSes for NOC
- Debian 9
- Debian 10
- Ubuntu 16 LTS
- Ubuntu 18 LTS
- Centos 7

## 90% Supported OSes for NOC
- FreeBSD 10
- RHEL 7
- Oracle Linux 7

Aleksey Shirokih's avatar
Aleksey Shirokih committed
19
## Install 
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
20

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

Aleksey Shirokih's avatar
Aleksey Shirokih committed
23
### Docker install
24

Aleksey Shirokih's avatar
Aleksey Shirokih committed
25
If tower and node does not have direct access to the internet [setup proxy](docs/proxy.md)
Aleksey Shirokih's avatar
Aleksey Shirokih committed
26
27


28
29
30
#### Install python-pip 
<details>
<summary>CentOS/RHEL </summary>
31

32
<pre><code>
33
34
yum install python-setuptools
easy_install pip
35
36
</code></pre>
</details>
37

38
39
<details>
<summary>Debian/Ubuntu</summary>
40

41
42
<pre><code>
apt update
43
apt install --no-install-recommends python-pip curl python-setuptools
44
45
46
47
</code></pre>
</details>

#### Install docker daemon
Aleksey Shirokih's avatar
Aleksey Shirokih committed
48
49
```
curl https://get.docker.com | sudo sh 
EKbfh's avatar
EKbfh committed
50
51
systemctl start docker
systemctl enable docker
Aleksey Shirokih's avatar
Aleksey Shirokih committed
52
```
53

54
#### Install docker compose 
55
```
56
57
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
EKbfh's avatar
EKbfh committed
58
# If u have an error about setuptools: pip install --upgrade setuptools
Aleksey Shirokih's avatar
Aleksey Shirokih committed
59
mkdir /etc/docker-compose/tower -p
Dmitry Volodin's avatar
Dmitry Volodin committed
60
61
```

Aleksey Shirokih's avatar
Aleksey Shirokih committed
62
63
### Setup tower 
Place `docker-compose.yml` from project root to `/etc/docker-compose/tower`
64
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
65
curl https://code.getnoc.com/noc/tower/raw/master/docker-compose.yml > /etc/docker-compose/tower/docker-compose.yml
66
cd /etc/docker-compose/tower
Aleksey Shirokih's avatar
Aleksey Shirokih committed
67
docker-compose up -d 
68
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
69
That it. 
Dmitry Volodin's avatar
Dmitry Volodin committed
70

71
<details>
Aleksey Shirokih's avatar
Aleksey Shirokih committed
72
<summary>Also you can choose the long way of manual installation without docker.</summary>
73
74

<ul dir="auto">
Aleksey Shirokih's avatar
Aleksey Shirokih committed
75
76
77
78
79
<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>
80
81
</ul>
</details>
Dmitry Lukhtionov's avatar
Dmitry Lukhtionov committed
82

Dmitry Volodin's avatar
Dmitry Volodin committed
83

Aleksey Shirokih's avatar
Aleksey Shirokih committed
84
85
86
## Prepare nodes
On each node 
* double check that python2.7 is installed on nodes
EKbfh's avatar
EKbfh committed
87
88
89
90
91
* create ansible user (*ansible* by default) and define ansible user's password, you'll need it later.
```
useradd -d /home/ansible -s /bin/bash -m ansible`
passwd ansible
``` 
EKbfh's avatar
EKbfh committed
92
* grant it passwordless `sudo` privileges(`ansible  ALL=(ALL) NOPASSWD:ALL` in /etc/sudoers) 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
93

94
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
95
/opt/tower# docker-compose exec tower ssh-copy-id  -f -i /opt/tower/var/tower/data/deploy_keys/id_rsa.pub ansible@192.168.1.88
96
```
EKbfh's avatar
EKbfh committed
97
where `192.168.1.88` is the node's IP address. Enter ansible's password, that you already defined somewhere above.
Dmitry Volodin's avatar
Dmitry Volodin committed
98

99
## Deploying
100

Aleksey Shirokih's avatar
Aleksey Shirokih committed
101
 - Enter noc control tower.
Dmitry Volodin's avatar
Dmitry Volodin committed
102
103
104
105
   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)
106

Aleksey Shirokih's avatar
Aleksey Shirokih committed
107
## Advanced topics 
108

Aleksey Shirokih's avatar
Aleksey Shirokih committed
109
110
* [Quick docker-compose notes](docs/docker-compose.md)
* [Environment variables](docs/env.md)
Aleksey Shirokih's avatar
Aleksey Shirokih committed
111
112
* [Writing own roles](docs/roles.md)
* [Migrating tower to docker](docs/migrate_dc.md)
113
* [Release policy](docs/versioning.md)