README.md 1.37 KB
Newer Older
Karim El Aammari's avatar
Karim El Aammari committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Getting started


## Packer
1.Create a ed25519 host key with follwing name "ssh_host_ed25519_key" accordingly "ssh_host_ed25519_key.pub" and move it into prvisioning/secrets.

```shell
cd alxmonitoring/offline/packer/provisioning
mkdir secrets
cd secrets
ssh-keygen -t ed25519
```

2.Create in also in folder ```alxmonitoring/offline/packer/provisioning``` a ```authorized_keys``` file and paste here the key you want use to connect via ssh.

3.Now you are ready to build the diskimage. Change into ```alxmonitoring/offline/packer``` folder and run the following command.

```shell
./build.sh archlinux-monitoring.json
```

## Ansible

4.Create the necessary TLS certificates with following script.

```shell
alxmonitoring/playbooks/files/openssl/script/generate.sh
```

5.Start the newly created diskimage with your hypervisor and obtain the assigned ip address. e.g.:

```shell
arp -i %virtual_network_name% -n
```

6.Change into ```alxmonitoring``` folder and change in ```inventory.yml```the variable 'ansible_host' to your vm's ip address.

7.Before Ansible can configure and provision the vm, we need to set an sudo password for user anible. e.g:

```shell
ssh root@%ip% -i %your_key%
passwd ansible
```

8.To configure and provision the newly created vm, run follwing ansible-playbook command.

```shell
ansible-playbook alxmonitoring.yml --extra-vars "ansible_sudo_pass=%sudopassword%"
```