Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

This role does not work with RPi 1 #207

Closed
ruzickap opened this issue Mar 3, 2020 · 1 comment
Closed

This role does not work with RPi 1 #207

ruzickap opened this issue Mar 3, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@ruzickap
Copy link
Contributor

ruzickap commented Mar 3, 2020

What happened?

I tried to use this role with RPi 1 and it failed on starting grafana because the role installed wrong Grafana package (which should be used for different architecture). The ansible hanged on starting the Grafana:

TASK [cloudalchemy.grafana : Wait for grafana to start (http/s)] ****************************************************************************************************************************
^C [ERROR]: User interrupted execution

How to reproduce it (as minimally and precisely as possible):

Use this role for RPi 1.

The problem is that the role installed grafana package which is used for different architecture than RPi 1.

The package which needs to be installed for RPi 1 is called grafana-rpi:

# apt info grafana-rpi
Package: grafana-rpi
Version: 6.6.2
Priority: extra
Section: default
Maintainer: [email protected]
Installed-Size: 105 MB
Depends: adduser, libfontconfig1
Replaces: grafana
Homepage: https://grafana.com
License: "Apache 2.0"
Vendor: Grafana
Download-Size: 34.5 MB
APT-Manual-Installed: yes
APT-Sources: https://packages.grafana.com/oss/deb stable/main armhf Packages
Description: Grafana

See the output of the installed Grafana binary (from grafana package) by this role on RPi 1:

# grafana-server -v
Illegal instruction

# file /usr/sbin/grafana-server
/usr/sbin/grafana-server: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, Go BuildID=VR3_MVeelr6lUtxh-FiC/WhAhrk7Cfr2Mx9j4LOiq/eTlx9LN1ZQVKzMNj77c_/4jP0L-YRbsWIRajjEw0Y, BuildID[sha1]=03a9f63913083fd2e4924a8cd9ef1ee7d776dd9e, not stripped

See the output of the manually installed package grafana-rpi on RPi 1:

# grafana-server -v
Version 6.6.2 (commit: 3fa63cfc34, branch: HEAD)

# file /usr/sbin/grafana-server
/usr/sbin/grafana-server: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, Go BuildID=mLx6ldZ16dAmPJvMxcXS/jhJAoWovPQDHMrfEeKcJ/8aEt9c0oC7zxKzhTacyd/qklm7FV0ydjKRepNKzcS, with debug_info, not stripped

Here are the facts about RPi 1 architecture:

...
            "ansible_architecture": "armv6l",
...
            "ansible_processor": [
                "0",
                "ARMv6-compatible processor rev 7 (v6l)"
            ],
...

Comparing to RPi 3 for example (which is working fine with the role):

...
            "ansible_architecture": "armv7l",
...
                "processor": [
                    "0",
                    "ARMv7 Processor rev 4 (v7l)",
                    "1",
                    "ARMv7 Processor rev 4 (v7l)",
                    "2",
                    "ARMv7 Processor rev 4 (v7l)",
                    "3",
                    "ARMv7 Processor rev 4 (v7l)"
                ],
...

Environment
Raspberry Pi 1 (RPi 1)

  • Role version:

Git master branch

  • Ansible version information:
$ ansible --version
ansible 2.9.5
  • Variables:
    - role: cloudalchemy.grafana
      grafana_security:
        admin_user: admin
        admin_password: "{{ grafana_admin_password }}"
      grafana_auth:
        anonymous:
          org_name: "Main Org."
          org_role: Viewer
      grafana_datasources:
        - name: "Prometheus"
          type: "prometheus"
          access: "proxy"
          url: "http://127.0.0.1:9090"
          isDefault: true
      grafana_dashboards:
        - dashboard_id: '1860'
          revision_id: '12'
          datasource: 'Prometheus'
        - dashboard_id: '3662'
          revision_id: '2'
          datasource: 'Prometheus'
  • Ansible playbook execution Logs:
$ ansible-playbook -i inventory/hosts main.yml

PLAY [all] **********************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Gather variables for each operating system] ********************************************************************************************************************
ok: [raspi1.xvx.cz] => (item=/home/pruzicka/git/ansible-raspbian/roles/cloudalchemy.grafana/vars/debian.yml)

TASK [cloudalchemy.grafana : Check variable types] ******************************************************************************************************************************************
ok: [raspi1.xvx.cz] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [cloudalchemy.grafana : Fail on unsupported system architectures] **********************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Fail when datasources aren't configured when dashboards are set to be installed] *******************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Fail when grafana admin user isn't set] ************************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Fail when grafana admin password isn't set] ********************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Fail on incorrect variable types in datasource definitions] ****************************************************************************************************
skipping: [raspi1.xvx.cz] => (item={'name': 'Prometheus', 'type': 'prometheus', 'access': 'proxy', 'url': 'http://127.0.0.1:9090', 'isDefault': True}) 

TASK [cloudalchemy.grafana : Fail on bad database configuration] ****************************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Fail when grafana domain isn't properly configured] ************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Fail when grafana_api_keys uses invalid role names] ************************************************************************************************************

TASK [cloudalchemy.grafana : Fail when grafana_ldap isn't set when grafana_auth.ldap is] ****************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Force grafana_use_provisioning to false if grafana_version is < 5.0 ( grafana_version is set to 'latest' )] ****************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Fail if grafana_port is lower than 1024 and grafana_cap_net_bind_service is not true] **************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Fail if grafana_server.socket not defined when in socket mode] *************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Install dependencies] ******************************************************************************************************************************************
changed: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Remove conflicting grafana packages] ***************************************************************************************************************************
ok: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Clean apt cache] ***********************************************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Add Grafana repository file [RHEL/CentOS]] *********************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Import Grafana GPG signing key [Debian/Ubuntu]] ****************************************************************************************************************
[WARNING]: Module remote_tmp /root/.ansible/tmp did not exist and was created with a mode of 0700, this may cause issues when running as another user. To avoid this, create the remote_tmp
dir with the correct permissions manually
changed: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Add Grafana repository [Debian/Ubuntu]] ************************************************************************************************************************
changed: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Install Grafana] ***********************************************************************************************************************************************
changed: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Ensure grafana configuration directories exist] ****************************************************************************************************************
changed: [raspi1.xvx.cz] => (item=/etc/grafana)
changed: [raspi1.xvx.cz] => (item=/etc/grafana/datasources)
ok: [raspi1.xvx.cz] => (item=/etc/grafana/provisioning)
ok: [raspi1.xvx.cz] => (item=/etc/grafana/provisioning/datasources)
ok: [raspi1.xvx.cz] => (item=/etc/grafana/provisioning/dashboards)
ok: [raspi1.xvx.cz] => (item=/etc/grafana/provisioning/notifiers)

TASK [cloudalchemy.grafana : Create grafana main configuration file] ************************************************************************************************************************
changed: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Create grafana LDAP configuration file] ************************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Create grafana directories] ************************************************************************************************************************************
ok: [raspi1.xvx.cz] => (item=/var/log/grafana)
ok: [raspi1.xvx.cz] => (item=/var/lib/grafana)
changed: [raspi1.xvx.cz] => (item=/var/lib/grafana/dashboards)
changed: [raspi1.xvx.cz] => (item=/var/lib/grafana/plugins)

TASK [cloudalchemy.grafana : Create grafana socket directory] *******************************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Ensure grafana socket directory created on startup] ************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Enable grafana to ports lower than port 1024] ******************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Enable and start Grafana systemd unit] *************************************************************************************************************************
changed: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Check which plugins are installed] *****************************************************************************************************************************
skipping: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Install plugins] ***********************************************************************************************************************************************

RUNNING HANDLER [cloudalchemy.grafana : restart grafana] ************************************************************************************************************************************
changed: [raspi1.xvx.cz]

TASK [cloudalchemy.grafana : Wait for grafana to start (http/s)] ****************************************************************************************************************************
^C [ERROR]: User interrupted execution
@ruzickap ruzickap added the bug Something isn't working label Mar 3, 2020
paulfantom pushed a commit that referenced this issue Mar 23, 2020
Fix RPi 1 issue when grafana-rpi package needs to be installed (#207)
@paulfantom
Copy link
Member

Closing as #208 is merged and role should work now with RPi 1

cosandr pushed a commit to cosandr/ansible-grafana that referenced this issue Aug 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants