1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Create a MySQL user for Snipe-IT [closed]

Discussão em 'Python' iniciado por Stack, Outubro 4, 2024 às 06:22.

  1. Stack

    Stack Membro Participativo

    I am a beginner in Devops practices and I want to deploy Snipe-IT on an AWS ec2 instance (ubuntu) via Ansible.

    But my playbook fails at this task

    • name: Create MySQL user for Snipe-IT become: true mysql_user: name: snipeuser password: snipe_password host: localhost priv: 'snipeit.*:ALL' state: present

    Here is the error I have:

    "msg": "A MySQL module is required: for Python 2.7 either PyMySQL, or MySQL-python, or for Python 3.X mysqlclient or PyMySQL. Consider setting ansible_python_interpreter to use the intended Python version."

    I tried this config to install msqlclient via pip3.8 but I still have the same error. what to do?

    • name: Update and upgrade apt packages become: true apt: upgrade: yes update_cache: yes - name: Install Python and MySQL dependencies apt: name: - libmysqlclient-dev - xmlsec1 - libxmlsec1-openssl state: present - name: Install pip for Python 3.8 apt: name: python3-pip state: present - name: Update pip to latest version pip: name: pip state: latest ex ecutable: pip3 - name: Install the mysqlclient package via pip3.8 pip: name: mysqlclient executable: pip3.8 - name: Add the path /usr/local/bin to the PATH for the user lineinfile: path: /etc/profile line: 'export PATH=/usr/local/bin:$PATH' create: yes - name: Load new environment variables shell: source /etc/profile args: executable: /bin/bash

    Continue reading...

Compartilhe esta Página