KerOS 6

How to write your playbook for a migration

The executed script is an Ansible playbook. See more details on this page to get started with.
However few precautions should be taken when writing it, which will allow to avoid potentials issues during the migration.
Here are some tips to write your playbook for a migration:

Retrieve your files

You can add a tree structure in the /keros/keros-installer-data/migration to organize your files.
Let's take the following example of files that you want to migrate to Keros6

/keros/keros-installer-data/migration
    ├── world.yaml
    ├── myapp1
        ├── file1
        ├── file2

In the playbook, they can be retrieved this way

  - !shell
    name: "Create myapp1 directory and copy files into it"
    cmd: mkdir -p /etc/myapp1/; cp ./myapp1/* /etc/myapp1/

Keep your frequency plan

You can keep your frequency plan by copying the file /etc/lorad/lorad.json in /keros/keros-installer-data/migration.

/keros/keros-installer-data/migration
    ├── world.yaml
    ├── lorad.json

The file must be modified to be compliant with Keros6. In the playbook, the following command should be used to keep the file working on Keros6

  - !shell
    name: "Copy lorad.json"
    cmd: conflex -ajo /etc/lorad/lorad.json ./lorad.json /usr/share/lorad/default_board.json

Execute some action that needs network connection

Before executing an action that needs network connection, we advise you to add the action to wait that the gateway is online before executing it.

In your playbook, you should add the "wait-online" task, before the action :

  - !shell
    name: "Wait online"
    cmd: connmand-wait-online --timeout=300
  - !shell
    name: "action that need a connection"
    cmd: apt update

Execute some action that needs time synchronization

Before executing an action that needs time synchronization, we advise you to add the action to wait that the gateway is synchronized before executing it.

In your playbook, you should add the "wait-sync" task, before the action :

  - !shell
    name: "Wait sync"
    cmd: chronyc waitsync
  - !shell
    name: "action that need a time sync"
    cmd: apt update