# Ansible based Installation

## Prerequisites

Nodeum is compatible with the RHEL, Rocky, and AlmaLinux families. Please refer to the software requirements for further details.

**Installing Nodeum Software**

Nodeum can be installed on either a physical server or a virtual machine. To learn more about hardware requirements, please refer to the official documentation. The installation process utilizes an Ansible Playbook or a Docker Image for setup.

Before starting the installation, verify that your system's configuration is fully completed.

To deploy the Nodeum Package, follow these instructions (ensure you have an internet connection):

1. Install wget:

   ```bash
   yum install wget
   ```
2. Download the Nodeum package:

   ```bash
   wget get.nodeum.io/public/nodeum-v2-x-y-zzz.tar.gz
   ```
3. Extract the package:

   ```bash
   tar -xvzf /root/nodeum-v2-x-y-zzz.tar.gz
   ```
4. Navigate to the extracted folder:

   ```bash
   cd v2-x-y
   ```

The inventory location is defined in `ansible.cfg`. It must be stored in a specific folder and be available for each installation. To do this, move the folder into the standard inventory location:

1. Create the Nodeum directory:

   ```bash
   mkdir ~/nodeum
   ```
2. Move the inventory:

   ```bash
   mv ./inventory ~/nodeum/inventory
   ```

#### Password Configuration

Passwords are crucial for internal database usage. It's essential to define them initially, as changes after the first installation should be avoided. Configure passwords in the following file:

`~/nodeum/inventory/group_vars/all/passwords-v1.yml`

For production systems, file encryption is highly recommended. Learn more by exploring the "Customize Your Installation" guide.

### Installation Guide

1. **Install EPEL Release:**

   ```
   $ yum install epel-release
   ```
2. **Install sshpass:**

   ```
   $ yum install sshpass
   ```

   *Note: This command is essential for installations on multiple nodes and for adding each host's fingerprint to the `known_hosts` file. You can do this by executing `ssh` commands on each node.*
3. **Verify Installation:**

   Execute the `check_install` playbook:

   ```
   $ ansible-playbook check_install.yml
   ```
4. **Run Installation:**

   If you are not using an encrypted password file, execute:

   ```
   $ ansible-playbook install.yml
   ```

{% hint style="info" %}
If Ansible requests a reboot, restart the server. Once it has restarted, execute the command again.
{% endhint %}

5. **Verification:**

After completing the playbook installation, verify that it finishes successfully and produces the expected output.

<figure><img src="https://1946775891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgzbGsZqZH8Ro8zxRYgwn%2Fuploads%2FAfKo6zx5wzIdokB6avGI%2Fimage.png?alt=media&#x26;token=121a2306-d608-46cf-b206-86c6c283b3d3" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Be aware that no results have failed.
{% endhint %}

**Accessing the Console**

To access the Console, open your browser and enter the URL: `http://your-nodeum-ip-address/` or use the DNS name associated with it.

If you cannot access the Console on the default HTTP port, it could be due to your local firewall settings. Ensure that your firewall is configured to permit HTTP/HTTPS traffic to the server.

#### Running Ansible Playbook with Encrypted Passwords

If you have an encrypted password file, execute the Ansible playbook using:

* Prompt for vault password:

  ```bash
  ansible-playbook --ask-vault-password install.yml
  ```
* Use a vault password file:

  ```bash
  ansible-playbook --vault-password-file=password_file install.yml
  ```

Even if the user is in the `sudoers` file, Ansible might still ask for a sudo password. Use the `-kK` options to prompt for both SSH and sudo passwords:

```bash
ansible-playbook install.yml -kK
```

#### Post-Ansible Verification

After completing the deployment, verify that all defined storage configurations are present in the data mover service. To do this, review the file located at `/etc/nodeum/mover.toml`.

#### Step 1: Verify Plugin Status

Ensure that the Object Storage plugin `s3.so` is correctly defined and enabled.

```yaml
/etc/nodeum/mover.toml
--

...

[[plugins]]
  path = "s3.so"

...
```

* [ ] plugin swift.so is well defined

```
/etc/nodeum/mover.toml
--

...

[[plugins]]
  path = "swift.so"

...
```

### Verify Configuration

#### For Mounted File system Storage

<pre><code><strong>/etc/nodeum/mover.toml
</strong><strong>--
</strong>...  
[[storages.options]]
  # Applying additional options to connect to POSIX file system
  type = "nas-share"
  parent_name = "data1"
  [storages.options.handler]
    # will always be considered mounted in this directory, no mounting will be 
    attempted
    always_mounted = true
    path = "/mnt/data1"
...
</code></pre>

#### For OpenStack Swift Storage

```yaml
/etc/nodeum/mover.toml
--
...
[[storages.options]]
  # Applying additional options to connect to OpenStack swift as IDP
  parent_name = "swift_connector"
  [storages.options.handler]
    region_name = "my-region"
    auth_url = "https://my-swift-storage-url/"
    identity_provider = "your provider"
    auth_protocol = "openid"
...
```

#### Configuration Change

To update your configuration, modify the `/etc/nodeum/mover.toml` file. Ensure you apply changes to all nodes if multiple nodes are running the mover service.

{% hint style="warning" %}
Please ensure <mark style="color:red;">**to save**</mark> the file and restart the mover service.
{% endhint %}

```bash
$ sudo systemctl restart nodeum_mover.target
```

{% hint style="info" %}
**Caution:** Manual changes will be overwritten if you relaunch Ansible without updating the `group_vars/all/options.yml` Ansible Inventory file. Always backport your manual changes to avoid losing them.
{% endhint %}

#### Customize Your Installation

You can define and automate various options during deployment. Visit the Customize Your Installation page for more information.
