Installing Erlang on Pi Zero 2W with Ansible support playbook

by rsolis
GNU/Linux ◆ xterm-256color ◆ bash 60 views

To install Ansible and create a playbook to install Erlang, GDB, build-essentials, and Git on your Raspberry Pi Zero 2 W running Raspbian 64-bit, follow these steps:

1. Install Ansible on Raspberry Pi

Since you’re using Raspbian, we can install Ansible using the default package manager. First, ensure that your system is updated.

Update your system:

sudo apt update && sudo apt upgrade -y

Install the required dependencies for Ansible:

sudo apt install software-properties-common python3 python3-pip -y

Install Ansible using apt:

sudo apt install ansible -y

Verify that Ansible is installed:

ansible --version

2. Create the Ansible Playbook

Ansible playbooks are written in YAML format. We will create a playbook to install Erlang, GDB, build-essential tools, and Git.

Create a directory for your playbook:

mkdir ~/ansible-playbooks
cd ~/ansible-playbooks

Create the playbook file:

nano install-dev-tools.yml

In the file, write the following playbook:

---
- name: Install Development Tools on Raspberry Pi
  hosts: localhost
  become: yes
  tasks:
    - name: Ensure the system is up-to-date
      apt:
        update_cache: yes
        upgrade: dist

    - name: Install Erlang
      apt:
        name: erlang
        state: present

    - name: Install GDB
      apt:
        name: gdb
        state: present

    - name: Install build-essential
      apt:
        name: build-essential
        state: present

    - name: Install Git
      apt:
        name: git
        state: present

3. Run the Playbook

To execute the playbook, run the following command in the terminal:

ansible-playbook install-dev-tools.yml

Ansible will ensure your Raspberry Pi is up-to-date and install Erlang, GDB, build-essential, and Git tools.

Summary

  • Install Ansible using pip3.
  • Create a playbook to automate the installation of development tools.
  • Run the playbook to install the required packages on your Raspberry Pi.

Let me know if you need help with the configuration or if you encounter any issues!