Skip to content
Snippets Groups Projects
config.md 3.03 KiB
Newer Older
# Configuration

## SSH

The Ansible deployment will be done through SSH, so you must be able to connect to all the involved hosts by using SSH public key authentication.

If you or your team do not have a SSH key pair, please create one with `ssh-keygen` :

```sh
ssh-keygen -t ed25519
```

The SSH **public key** (`~/.ssh/id_ed25519.pub`) must then be added to the authorized keys (`~/.ssh/authorized_keys`) of the `root` account of all the involved hosts (mymediaserver, mymediaworker, mymediavault, etc.).

It is recommended to also use a SSH config file for your hosts, especially if some of them are protected by a bastion host. For example, let's assume that "mymediaserver" is used as a bastion to join "mymediaworker" and "mymediavault":

```ssh
Host mymediaserver
	Hostname	1.2.3.4
  IdentityFile	~/.ssh/id_ed25519
  User		root

Host mymediaworker
	Hostname	10.0.0.2
  IdentityFile	~/.ssh/id_ed25519
  User		root
  # use mymediaserver as a jump host
  ProxyJump	mymediaserver

Host mymediavault
	Hostname	10.0.0.3
  IdentityFile	~/.ssh/id_ed25519
  User		root
  # use mymediaserver as a jump host
  ProxyJump	mymediaserver
```

## Customer informations

The customer must provides some informations about its network, desired URLs, etc. You can use this [deployment form template](https://docs.google.com/document/d/13_t6LqlIkIMo3KEOsLWKfk_kB3Xw1JHktOOFbCHhxwY/) as a base to send to the customer.

When the deployment form is completed by the customer, send it to the [UbiCast deployment team](mailto:deploiements@ubicast.eu) who will put the data in the [fleet management](https://mirismanager.ubicast.eu/) tool.

Once the deployment team have updated the data for the hosts, the deployment can begin.

## Inventory

Make a copy of the `example` inventory and eventually customize it with the customer informations.

```sh
cp -r inventories/example inventories/my-customer
```

### Hosts and Groups

Edit `inventories/my-customer/hosts` to match with `my-customer` inrastructure.

For example, if there is only a MediaServer and a MediaWorker you can remove all other hosts and groups:

```ini
mymediaserver
mymediaworker
mymediavault

mymediaserver

[postgres]
mymediaserver

[mirismanager]
mymediaserver

mymediaserver

[wowza]
mymediaserver

[celerity]
mymediaserver

mymediaworker

mymediavault
```

### Variables

You **must at least** configure:
- `skyreach_system_key` values in `inventories/my-customer/host_vars/<host>.yml`

If you want to set/override a variable for:
- all: `inventories/my-customer/group_vars/all.yml`.
- a group:`inventories/my-customer/group_vars/<group>.yml`.
- a host: `inventories/my-customer/host_vars/<host>.yml`.

## Testing

Make sure Ansible can connect to all the hosts:

```sh
ansible -i inventories/my-customer -m ping all
```

If it works, it should looks like this:

```
mymediaserver | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
mymediaworker | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
mymediavault | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
```