Readme.md 2.41 KB
Newer Older
Dmitry Volodin's avatar
Dmitry Volodin committed
1
2
# NOC Tower
NOC Tower is the tool for deployment and maintaining multiple
EKbfh's avatar
EKbfh committed
3
NOC (https://getnoc.com/) 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
## 100% Supported OSes for NOC
- Debian 9
- Debian 10
EKbfh's avatar
EKbfh committed
10
- Debian 11
EKbfh's avatar
EKbfh committed
11
12
- Ubuntu 16 LTS
- Ubuntu 18 LTS
EKbfh's avatar
EKbfh committed
13
- Ubuntu 20 LTS
EKbfh's avatar
EKbfh committed
14
- Centos 7
EKbfh's avatar
EKbfh committed
15
- RHEL 7
EKbfh's avatar
EKbfh committed
16
17

## 90% Supported OSes for NOC
EKbfh's avatar
EKbfh committed
18
- FreeBSD
EKbfh's avatar
EKbfh committed
19
20
- Oracle Linux 7

Aleksey Shirokih's avatar
Aleksey Shirokih committed
21
## Install 
Aleksey Shirokih's avatar
Fix doc    
Aleksey Shirokih committed
22

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

Aleksey Shirokih's avatar
Aleksey Shirokih committed
25
### Docker install
26

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

29
#### Install docker daemon
Aleksey Shirokih's avatar
Aleksey Shirokih committed
30
31
```
curl https://get.docker.com | sudo sh 
EKbfh's avatar
EKbfh committed
32
33
systemctl start docker
systemctl enable docker
Aleksey Shirokih's avatar
Aleksey Shirokih committed
34
```
35

36
#### Install docker compose 
37
```
EKbfh's avatar
EKbfh committed
38
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
39
sudo chmod +x /usr/local/bin/docker-compose
EKbfh's avatar
EKbfh committed
40
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Aleksey Shirokih's avatar
Aleksey Shirokih committed
41
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

Aleksey Shirokih's avatar
Aleksey Shirokih committed
53
54
## Prepare nodes
On each node 
EKbfh's avatar
EKbfh committed
55
56
* create ansible user (*ansible* by default) and define ansible user's password, you'll need it later.
```
EKbfh's avatar
EKbfh committed
57
useradd -d /home/ansible -s /bin/bash -m ansible
EKbfh's avatar
EKbfh committed
58
59
passwd ansible
``` 
EKbfh's avatar
EKbfh committed
60
* 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
61

62
```
Aleksey Shirokih's avatar
Aleksey Shirokih committed
63
/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
64
```
EKbfh's avatar
EKbfh committed
65
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
66

67
## Deploying
68

Aleksey Shirokih's avatar
Aleksey Shirokih committed
69
 - Enter noc control tower.
Dmitry Volodin's avatar
Dmitry Volodin committed
70
71
72
73
   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)
74

Aleksey Shirokih's avatar
Aleksey Shirokih committed
75
## Advanced topics 
76

Aleksey Shirokih's avatar
Aleksey Shirokih committed
77
78
* [Quick docker-compose notes](docs/docker-compose.md)
* [Environment variables](docs/env.md)
Aleksey Shirokih's avatar
Aleksey Shirokih committed
79
80
* [Writing own roles](docs/roles.md)
* [Migrating tower to docker](docs/migrate_dc.md)
81
* [Release policy](docs/versioning.md)