Jump to content

Recommended Posts

Всем доброго!

Искал способ обойти блокировки сайтов на уровне роутера, нашел для себя подходящий вариант .

Но тут возникла проблема, по инструкции, последним этапом нужно ввести команду:

ansible-playbook hirkn.yml -i hosts

На что я получаю такой ответ:

-sh: ansible-playbook: not found

Мне посоветовали дословно:

Цитата

Сначала загугли, что такое ansible-playbook. И поймёте, что нужно сначала установить ansible, а уж потом выполнять команду.

Ну я пошел в гугл, там нашел несколько статей как устанавливать этот ansible, но по ним я так и не смог установить, так как инструкции не для keenetic, и по их командам там нет нужного пакета.

Например пытался установить по такой команде: opkg install ansible-base, но такого пакета нет.

У меня назрели вопросы, где я могу найти нужный мне пакет ansible? И решит ли установка данного пакета, исполнение команды ansible-playbook, или нужно еще что-то настраивать и устанавливать?

Я в этом всем чайник, если написал что-то глупое, не серчайте)

 

 

Link to comment
Share on other sites

Установил python3-pip, попробовал установить ansible отсюда , но безуспешно.

Вот что пишет:

Скрытый текст

Collecting ansible
  Downloading ansible-5.6.0.tar.gz (35.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.5/35.5 MB 336.2 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting ansible-core~=2.12.4
  Downloading ansible-core-2.12.4.tar.gz (7.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.8/7.8 MB 370.8 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting jinja2
  Using cached Jinja2-3.1.1-py3-none-any.whl (132 kB)
Collecting PyYAML
  Using cached PyYAML-6.0.tar.gz (124 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cryptography
  Using cached cryptography-36.0.2.tar.gz (572 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [80 lines of output]
      Collecting setuptools>=40.6.0
        Using cached setuptools-62.1.0-py3-none-any.whl (1.1 MB)
      Collecting wheel
        Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
      Collecting cffi>=1.12
        Using cached cffi-1.15.0.tar.gz (484 kB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting setuptools-rust>=0.11.4
        Using cached setuptools_rust-1.2.0-py3-none-any.whl (21 kB)
      Collecting pycparser
        Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
      Collecting typing-extensions>=3.7.4.3
        Using cached typing_extensions-4.2.0-py3-none-any.whl (24 kB)
      Collecting semantic-version<3,>=2.8.2
        Using cached semantic_version-2.9.0-py2.py3-none-any.whl (15 kB)
      Using legacy 'setup.py install' for cffi, since package 'wheel' is not installed.
      Installing collected packages: wheel, typing-extensions, setuptools, semantic-version, pycparser, setuptools-rust, cffi
        Running setup.py install for cffi: started
        Running setup.py install for cffi: finished with status 'error'
        error: subprocess-exited-with-error

        × Running setup.py install for cffi did not run successfully.
        │ exit code: 1
        ╰─> [45 lines of output]

                No working compiler found, or bogus compiler options passed to
                the compiler from Python's standard "distutils" module.  See
                the error messages above.  Likely, the problem is not related
                to CFFI but generic to the setup.py of any Python package that
                tries to compile C code.  (Hints: on OS/X 10.8, for errors about
                -mno-fused-madd see http://stackoverflow.com/questions/22313407/
                Otherwise, see https://wiki.python.org/moin/CompLangPython or
                the IRC channel #python on irc.libera.chat.)

                Trying to continue anyway.  If you are trying to install CFFI from
                a build done in a different context, you can ignore this warning.

            running install
            running build
            running build_py
            creating build
            creating build/lib.linux-mips-3.10
            creating build/lib.linux-mips-3.10/cffi
            copying cffi/backend_ctypes.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/vengine_gen.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/__init__.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/lock.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/setuptools_ext.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/vengine_cpy.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/error.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/api.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/cparser.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/recompiler.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/commontypes.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/model.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/cffi_opcode.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/ffiplatform.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/pkgconfig.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/verifier.py -> build/lib.linux-mips-3.10/cffi
            copying cffi/_cffi_include.h -> build/lib.linux-mips-3.10/cffi
            copying cffi/parse_c_type.h -> build/lib.linux-mips-3.10/cffi
            copying cffi/_embedding.h -> build/lib.linux-mips-3.10/cffi
            copying cffi/_cffi_errors.h -> build/lib.linux-mips-3.10/cffi
            running build_ext
            building '_cffi_backend' extension
            creating build/temp.linux-mips-3.10
            creating build/temp.linux-mips-3.10/c
            gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -pthread -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -pthread -I/opt/include -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/opt/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-mips-3.10/c/_cffi_backend.o
            error: command 'gcc' failed: No such file or directory
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: legacy-install-failure

      × Encountered error while trying to install package.
      ╰─> cffi

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Я так полагаю он для mips грузит, а мне нужен mipsel?

Edited by Tiko
Link to comment
Share on other sites

А точно оно надо, может есть другие варианты?

Сперва прочитать и выполнить:

https://github.com/Entware/Entware/wiki/Using-GCC-for-native-compilation и https://github.com/Entware/Entware/wiki/Self-installation-of-python-modules

Дальше пытаться установить:

Скрытый текст
BusyBox v1.35.0 (2022-04-13 08:47:51 UTC) built-in shell (ash)

~ # python -m pip install ansible
Collecting ansible
  Downloading ansible-5.6.0.tar.gz (35.5 MB)
     |████████████████████████████████| 35.5 MB 2.4 kB/s 
Collecting ansible-core~=2.12.4
  Downloading ansible-core-2.12.4.tar.gz (7.8 MB)
     |████████████████████████████████| 7.8 MB 54 kB/s 
Requirement already satisfied: jinja2 in /opt/lib/python3.10/site-packages (from ansible-core~=2.12.4->ansible) (3.1.0)
Requirement already satisfied: PyYAML in /opt/lib/python3.10/site-packages (from ansible-core~=2.12.4->ansible) (6.0)
Requirement already satisfied: cryptography in /opt/lib/python3.10/site-packages (from ansible-core~=2.12.4->ansible) (36.0.0)
Collecting packaging
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting resolvelib<0.6.0,>=0.5.3
  Downloading resolvelib-0.5.4-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: cffi>=1.12 in /opt/lib/python3.10/site-packages (from cryptography->ansible-core~=2.12.4->ansible) (1.15.0)
Requirement already satisfied: pycparser in /opt/lib/python3.10/site-packages (from cffi>=1.12->cryptography->ansible-core~=2.12.4->ansible) (2.21)
Requirement already satisfied: MarkupSafe>=2.0 in /opt/lib/python3.10/site-packages (from jinja2->ansible-core~=2.12.4->ansible) (2.1.0)
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.0.8-py3-none-any.whl (98 kB)
     |████████████████████████████████| 98 kB 1.0 MB/s 
Using legacy 'setup.py install' for ansible, since package 'wheel' is not installed.
Using legacy 'setup.py install' for ansible-core, since package 'wheel' is not installed.
Installing collected packages: pyparsing, resolvelib, packaging, ansible-core, ansible
    Running setup.py install for ansible-core ... done
    Running setup.py install for ansible ... done
Successfully installed ansible-5.6.0 ansible-core-2.12.4 packaging-21.3 pyparsing-3.0.8 resolvelib-0.5.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
You should consider upgrading via the '/opt/bin/python -m pip install --upgrade pip' command.
~ # 
~ # ansible
ansible             ansible-connection  ansible-doc         ansible-inventory   ansible-pull        ansible-vault
ansible-config      ansible-console     ansible-galaxy      ansible-playbook    ansible-test
~ # ansible --version
-sh: ansible: not found
~ # 
~ # grep -E '^#!.*python' /opt/bin/ansible*
/opt/bin/ansible:#!/usr/bin/env python
/opt/bin/ansible-config:#!/usr/bin/env python
/opt/bin/ansible-connection:#!/usr/bin/env python
/opt/bin/ansible-console:#!/usr/bin/env python
/opt/bin/ansible-doc:#!/usr/bin/env python
/opt/bin/ansible-galaxy:#!/usr/bin/env python
/opt/bin/ansible-inventory:#!/usr/bin/env python
/opt/bin/ansible-playbook:#!/usr/bin/env python
/opt/bin/ansible-pull:#!/usr/bin/env python
/opt/bin/ansible-test:#!/usr/bin/env python
/opt/bin/ansible-vault:#!/usr/bin/env python
~ # 
~ # ls -al /opt/bin/ansible*
-rwxr-xr-x    1 root     root          5918 Apr 24 11:45 /opt/bin/ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-config -> ansible
-rwxr-xr-x    1 root     root         13400 Mar 28 21:28 /opt/bin/ansible-connection
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-console -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-doc -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-galaxy -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-inventory -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-playbook -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-pull -> ansible
-rwxr-xr-x    1 root     root          1477 Mar 28 21:28 /opt/bin/ansible-test
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-vault -> ansible
~ # 
~ # sed -i -e 's,^#!.*python,#!/opt/bin/python,' /opt/bin/ansible
~ # sed -i -e 's,^#!.*python,#!/opt/bin/python,' /opt/bin/ansible-connection 
~ # sed -i -e 's,^#!.*python,#!/opt/bin/python,' /opt/bin/ansible-test 
~ # 
~ # ansible --version
ansible [core 2.12.4]
  config file = None
  configured module search path = ['/opt/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/lib/python3.10/site-packages/ansible
  ansible collection location = /opt/root/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/bin/ansible
  python version = 3.10.4 (main, Apr 13 2022, 08:47:51) [GCC 7.4.0]
  jinja version = 3.1.0
  libyaml = True
~ # 

 

 

  • Thanks 1
Link to comment
Share on other sites

2 часа назад, TheBB сказал:

А точно оно надо, может есть другие варианты?

Сперва прочитать и выполнить:

https://github.com/Entware/Entware/wiki/Using-GCC-for-native-compilation и https://github.com/Entware/Entware/wiki/Self-installation-of-python-modules

Дальше пытаться установить:

  Показать содержимое
BusyBox v1.35.0 (2022-04-13 08:47:51 UTC) built-in shell (ash)

~ # python -m pip install ansible
Collecting ansible
  Downloading ansible-5.6.0.tar.gz (35.5 MB)
     |████████████████████████████████| 35.5 MB 2.4 kB/s 
Collecting ansible-core~=2.12.4
  Downloading ansible-core-2.12.4.tar.gz (7.8 MB)
     |████████████████████████████████| 7.8 MB 54 kB/s 
Requirement already satisfied: jinja2 in /opt/lib/python3.10/site-packages (from ansible-core~=2.12.4->ansible) (3.1.0)
Requirement already satisfied: PyYAML in /opt/lib/python3.10/site-packages (from ansible-core~=2.12.4->ansible) (6.0)
Requirement already satisfied: cryptography in /opt/lib/python3.10/site-packages (from ansible-core~=2.12.4->ansible) (36.0.0)
Collecting packaging
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting resolvelib<0.6.0,>=0.5.3
  Downloading resolvelib-0.5.4-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: cffi>=1.12 in /opt/lib/python3.10/site-packages (from cryptography->ansible-core~=2.12.4->ansible) (1.15.0)
Requirement already satisfied: pycparser in /opt/lib/python3.10/site-packages (from cffi>=1.12->cryptography->ansible-core~=2.12.4->ansible) (2.21)
Requirement already satisfied: MarkupSafe>=2.0 in /opt/lib/python3.10/site-packages (from jinja2->ansible-core~=2.12.4->ansible) (2.1.0)
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.0.8-py3-none-any.whl (98 kB)
     |████████████████████████████████| 98 kB 1.0 MB/s 
Using legacy 'setup.py install' for ansible, since package 'wheel' is not installed.
Using legacy 'setup.py install' for ansible-core, since package 'wheel' is not installed.
Installing collected packages: pyparsing, resolvelib, packaging, ansible-core, ansible
    Running setup.py install for ansible-core ... done
    Running setup.py install for ansible ... done
Successfully installed ansible-5.6.0 ansible-core-2.12.4 packaging-21.3 pyparsing-3.0.8 resolvelib-0.5.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
You should consider upgrading via the '/opt/bin/python -m pip install --upgrade pip' command.
~ # 
~ # ansible
ansible             ansible-connection  ansible-doc         ansible-inventory   ansible-pull        ansible-vault
ansible-config      ansible-console     ansible-galaxy      ansible-playbook    ansible-test
~ # ansible --version
-sh: ansible: not found
~ # 
~ # grep -E '^#!.*python' /opt/bin/ansible*
/opt/bin/ansible:#!/usr/bin/env python
/opt/bin/ansible-config:#!/usr/bin/env python
/opt/bin/ansible-connection:#!/usr/bin/env python
/opt/bin/ansible-console:#!/usr/bin/env python
/opt/bin/ansible-doc:#!/usr/bin/env python
/opt/bin/ansible-galaxy:#!/usr/bin/env python
/opt/bin/ansible-inventory:#!/usr/bin/env python
/opt/bin/ansible-playbook:#!/usr/bin/env python
/opt/bin/ansible-pull:#!/usr/bin/env python
/opt/bin/ansible-test:#!/usr/bin/env python
/opt/bin/ansible-vault:#!/usr/bin/env python
~ # 
~ # ls -al /opt/bin/ansible*
-rwxr-xr-x    1 root     root          5918 Apr 24 11:45 /opt/bin/ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-config -> ansible
-rwxr-xr-x    1 root     root         13400 Mar 28 21:28 /opt/bin/ansible-connection
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-console -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-doc -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-galaxy -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-inventory -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-playbook -> ansible
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-pull -> ansible
-rwxr-xr-x    1 root     root          1477 Mar 28 21:28 /opt/bin/ansible-test
lrwxrwxrwx    1 root     root             7 Apr 24 00:25 /opt/bin/ansible-vault -> ansible
~ # 
~ # sed -i -e 's,^#!.*python,#!/opt/bin/python,' /opt/bin/ansible
~ # sed -i -e 's,^#!.*python,#!/opt/bin/python,' /opt/bin/ansible-connection 
~ # sed -i -e 's,^#!.*python,#!/opt/bin/python,' /opt/bin/ansible-test 
~ # 
~ # ansible --version
ansible [core 2.12.4]
  config file = None
  configured module search path = ['/opt/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/lib/python3.10/site-packages/ansible
  ansible collection location = /opt/root/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/bin/ansible
  python version = 3.10.4 (main, Apr 13 2022, 08:47:51) [GCC 7.4.0]
  jinja version = 3.1.0
  libyaml = True
~ # 

 

 

Спасибо, но я уже вручную все установил из файла hirkn.yml с заменой префиксов, но скрипт оказался нерабочим или где-то ошибся. Буду искать другой вариант.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...