]> git.phdru.name Git - ansible.git/blobdiff - playbooks/redhat/roles/init-system/tasks/python.yml
Feat(RedHat): Add RedHat and redhatoids playbooks and roles
[ansible.git] / playbooks / redhat / roles / init-system / tasks / python.yml
diff --git a/playbooks/redhat/roles/init-system/tasks/python.yml b/playbooks/redhat/roles/init-system/tasks/python.yml
new file mode 100644 (file)
index 0000000..15dc994
--- /dev/null
@@ -0,0 +1,17 @@
+- name: Install Python and packages
+  become: true
+  dnf:
+    name: ['python2', 'python3', 'python2-pip', 'python3-pip',
+           'python2-setuptools', 'python3-setuptools',
+          ]
+    state: latest
+    update_cache: yes
+  register: python
+
+- name: Upgrade Python packages
+  become: true
+  shell: 'umask 022; {{ item }} -m pip install --upgrade
+      "pip < 19.1" setuptools tox virtualenv virtualenvwrapper "wheel < 0.31.1"
+      flake8 sphinx twine'
+  when: python.changed
+  loop: ['python3', 'python2']