Advertisement
konstest

Untitled

Jan 15th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. # Данный стэйт накатывает оба python2/python3 и их pip модули
  2. # далее обновляет до последней версии pip модули
  3.  
  4. # В других стэйтах будет будет использоваться так:
  5. #include:
  6. # - pythons
  7.  
  8. Install all pythons:
  9. pkg.installed:
  10. - pkgs:
  11. - python
  12. - python-dev
  13. - python3
  14. - python3-dev
  15.  
  16. /tmp/get-pip.py:
  17. file.managed:
  18. - source:
  19. - https://repo.ptsecurity.ru/artifactory/scm/salt/pip/get-pip.py
  20. - https://bootstrap.pypa.io/get-pip.py
  21. - source_hash: md5=3b74f5cd0740a05802a23b019ce579a3
  22.  
  23. Install pip2 by script:
  24. cmd.run:
  25. - name: |
  26. python2 /tmp/get-pip.py
  27. - unless: test -f /usr/local/bin/pip2
  28. - require:
  29. - file: /tmp/get-pip.py
  30. - reload_modules: True
  31.  
  32. Install pip3 by script:
  33. cmd.run:
  34. - name: |
  35. python3 /tmp/get-pip.py
  36. - unless: test -f /usr/local/bin/pip3
  37. - require:
  38. - file: /tmp/get-pip.py
  39. - reload_modules: True
  40.  
  41. Upgrade pip for pythons:
  42. cmd.run:
  43. - name: |
  44. python2 -m pip install --upgrade pip==9.0.1; \
  45. python3 -m pip install --upgrade pip==9.0.1
  46. - require:
  47. - cmd: Install pip2 by script
  48. - cmd: Install pip3 by script
  49.  
  50. Install and upgrade a standart pip2 package:
  51. pip.installed:
  52. - pkgs:
  53. - setuptools
  54. - wheel
  55. - requests
  56. - bin_env: '/usr/local/bin/pip2'
  57. - upgrade: True
  58. - require:
  59. - cmd: Install pip2 by script
  60.  
  61. Install and upgrade a standart pip3 package:
  62. pip.installed:
  63. - pkgs:
  64. - setuptools
  65. - wheel
  66. - requests
  67. - bin_env: '/usr/local/bin/pip3'
  68. - upgrade: True
  69. - require:
  70. - cmd: Install pip3 by script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement