From: Oleg Broytman Date: Sun, 1 Sep 2019 18:44:41 +0000 (+0300) Subject: Feat(python): Install dev packages to compile Python from sources X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a62158107fbe1dd340040cf4ebee3da6d957ccf6;p=ansible.git Feat(python): Install dev packages to compile Python from sources Install development packages: headers and libraries. Split roles `dev-packages` into `python-dev-packages`. --- diff --git a/playbooks/debian/roles/dev-packages/tasks/main.yml b/playbooks/debian/roles/dev-packages/tasks/main.yml index ed96abf..e523f95 100644 --- a/playbooks/debian/roles/dev-packages/tasks/main.yml +++ b/playbooks/debian/roles/dev-packages/tasks/main.yml @@ -5,7 +5,12 @@ autoremove: yes cache_valid_time: 3600 install_recommends: no - name: ['gcc', 'g++', 'git', 'make', + name: ['g++', 'gcc', 'git', + 'libexpat1', 'libffi6', + 'libgdbm{% if debian_distr == "stretch" %}3{% elif debian_distr == "buster" %}6{% endif %}', + 'libgmp10', + 'liblzma5', 'libmpdec2', 'libreadline5', 'libreadline7', + 'make', 'openssl', 'patch', 'sqlite3', 'zlib1g', ] state: latest update_cache: yes diff --git a/playbooks/debian/roles/init-system/tasks/main.yml b/playbooks/debian/roles/init-system/tasks/main.yml index ee33743..83104c7 100644 --- a/playbooks/debian/roles/init-system/tasks/main.yml +++ b/playbooks/debian/roles/init-system/tasks/main.yml @@ -3,6 +3,3 @@ - name: locales import_tasks: locales.yml - -- name: Python - import_tasks: python.yml diff --git a/playbooks/debian/roles/python-dev-packages/README.txt b/playbooks/debian/roles/python-dev-packages/README.txt new file mode 100644 index 0000000..fefd813 --- /dev/null +++ b/playbooks/debian/roles/python-dev-packages/README.txt @@ -0,0 +1 @@ +Install Python development packages. diff --git a/playbooks/debian/roles/python-dev-packages/meta/main.yml b/playbooks/debian/roles/python-dev-packages/meta/main.yml new file mode 100644 index 0000000..4f10846 --- /dev/null +++ b/playbooks/debian/roles/python-dev-packages/meta/main.yml @@ -0,0 +1 @@ +dependencies: ['dev-packages', 'python-packages'] diff --git a/playbooks/debian/roles/python-dev-packages/tasks/main.yml b/playbooks/debian/roles/python-dev-packages/tasks/main.yml new file mode 100644 index 0000000..0b3f99b --- /dev/null +++ b/playbooks/debian/roles/python-dev-packages/tasks/main.yml @@ -0,0 +1,29 @@ +- name: Install development packages For Debbian 9 stretch + become: true + apt: + autoclean: yes + autoremove: yes + cache_valid_time: 3600 + install_recommends: no + name: ['libssl1.0-dev', 'libssl1.0.2', + ] + state: latest + update_cache: yes + when: debian_distr == "stretch" + +- name: Install development packages + become: true + apt: + autoclean: yes + autoremove: yes + cache_valid_time: 3600 + install_recommends: no + name: ['libbz2-dev', 'libexpat1-dev', 'libffi-dev', + 'libgdbm-dev', 'libgmp-dev', 'libmpdec-dev', 'liblzma-dev', + 'libncurses5', 'libncurses5-dev', 'libncursesw5', 'libncursesw5-dev', + 'libpython-dev', 'libpython3-dev', 'libreadline-dev', + 'libsqlite3-dev', 'libssl-dev', 'libssl1.1', + 'python-dev', 'python3-dev', 'zlib1g-dev', + ] + state: latest + update_cache: yes diff --git a/playbooks/debian/roles/python-packages/README.txt b/playbooks/debian/roles/python-packages/README.txt new file mode 100644 index 0000000..f766e45 --- /dev/null +++ b/playbooks/debian/roles/python-packages/README.txt @@ -0,0 +1 @@ +Install Python packages. diff --git a/playbooks/debian/roles/init-system/tasks/python.yml b/playbooks/debian/roles/python-packages/tasks/main.yml similarity index 90% rename from playbooks/debian/roles/init-system/tasks/python.yml rename to playbooks/debian/roles/python-packages/tasks/main.yml index ead9aa5..2509ea1 100644 --- a/playbooks/debian/roles/init-system/tasks/python.yml +++ b/playbooks/debian/roles/python-packages/tasks/main.yml @@ -7,6 +7,7 @@ install_recommends: no name: ['python', 'python2.7', 'python3', 'python-pip', 'python3-pip', 'python-setuptools', 'python3-setuptools', + 'python-gdbm', 'python-openssl', 'python3-openssl', ] state: latest update_cache: yes diff --git a/playbooks/redhat/roles/dev-packages/tasks/main.yml b/playbooks/redhat/roles/dev-packages/tasks/main.yml index ed57bf4..22fd224 100644 --- a/playbooks/redhat/roles/dev-packages/tasks/main.yml +++ b/playbooks/redhat/roles/dev-packages/tasks/main.yml @@ -1,7 +1,10 @@ - name: Install development packages become: true dnf: - name: ['gcc', 'gcc-c++', 'git', 'make', + name: ['expat', 'gcc', 'gcc-c++', + 'gdbm', 'gdbm-libs', 'git', 'gmp', + 'libffi', 'lzma-sdk', 'make', 'mpdecimal', + 'openssl', 'patch', 'readline', 'sqlite', 'zlib', ] state: latest update_cache: yes diff --git a/playbooks/redhat/roles/init-system/tasks/main.yml b/playbooks/redhat/roles/init-system/tasks/main.yml index fbef08b..edfcd82 100644 --- a/playbooks/redhat/roles/init-system/tasks/main.yml +++ b/playbooks/redhat/roles/init-system/tasks/main.yml @@ -1,5 +1,2 @@ - name: packages import_tasks: dnf.yml - -- name: Python - import_tasks: python.yml diff --git a/playbooks/redhat/roles/python-dev-packages/README.txt b/playbooks/redhat/roles/python-dev-packages/README.txt new file mode 100644 index 0000000..13d6c5f --- /dev/null +++ b/playbooks/redhat/roles/python-dev-packages/README.txt @@ -0,0 +1 @@ +Install development packages. diff --git a/playbooks/redhat/roles/python-dev-packages/meta/main.yml b/playbooks/redhat/roles/python-dev-packages/meta/main.yml new file mode 100644 index 0000000..4f10846 --- /dev/null +++ b/playbooks/redhat/roles/python-dev-packages/meta/main.yml @@ -0,0 +1 @@ +dependencies: ['dev-packages', 'python-packages'] diff --git a/playbooks/redhat/roles/python-dev-packages/tasks/main.yml b/playbooks/redhat/roles/python-dev-packages/tasks/main.yml new file mode 100644 index 0000000..f5e04e9 --- /dev/null +++ b/playbooks/redhat/roles/python-dev-packages/tasks/main.yml @@ -0,0 +1,11 @@ +- name: Install development packages + become: true + dnf: + name: ['bzip2-devel', 'expat-devel', 'gdbm-devel', 'gmp-devel', + 'libffi-devel', 'lzma-sdk-devel', 'mpdecimal-devel', + 'ncurses-devel', 'ncurses-libs', 'openssl-devel', 'openssl-libs', + 'python2-devel', 'python3-devel', 'readline-devel', 'sqlite-devel', + 'xz-devel', 'xz-libs', 'zlib-devel', + ] + state: latest + update_cache: yes diff --git a/playbooks/redhat/roles/python-packages/README.txt b/playbooks/redhat/roles/python-packages/README.txt new file mode 100644 index 0000000..f766e45 --- /dev/null +++ b/playbooks/redhat/roles/python-packages/README.txt @@ -0,0 +1 @@ +Install Python packages. diff --git a/playbooks/redhat/roles/init-system/tasks/python.yml b/playbooks/redhat/roles/python-packages/tasks/main.yml similarity index 90% rename from playbooks/redhat/roles/init-system/tasks/python.yml rename to playbooks/redhat/roles/python-packages/tasks/main.yml index 15dc994..ef81490 100644 --- a/playbooks/redhat/roles/init-system/tasks/python.yml +++ b/playbooks/redhat/roles/python-packages/tasks/main.yml @@ -3,6 +3,7 @@ dnf: name: ['python2', 'python3', 'python2-pip', 'python3-pip', 'python2-setuptools', 'python3-setuptools', + 'python2-pyOpenSSL', 'python3-pyOpenSSL', ] state: latest update_cache: yes