From 28b19fe06421cfdce9ab1721ddc099ec80ec47af Mon Sep 17 00:00:00 2001 From: Julian Gethmann Date: Mon, 13 Mar 2017 09:09:34 +0100 Subject: [PATCH] Add pre-commit and its dependencies * Add pre-commit * Add dependencies * Begin to avoid the ansible YAML short hand notation --- group_vars/python.yml | 1 + roles/common/handlers/main.yml | 4 --- roles/python_stack/tasks/python.yml | 45 +++++++++++++++++++---------- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/group_vars/python.yml b/group_vars/python.yml index e474f60..bcfeaed 100644 --- a/group_vars/python.yml +++ b/group_vars/python.yml @@ -14,6 +14,7 @@ python3pkg: python3pip: - brewer2mpl - PyScaffold + - pre-commit - flake8 python2pkg: diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 3bc6d3c..e1abda2 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -23,10 +23,6 @@ become: yes service: name=ntpdate state=started -- name: lock root user - become: yes - shell: passwd -l root - - name: update-ca-trust become: yes command: update-ca-trust extract diff --git a/roles/python_stack/tasks/python.yml b/roles/python_stack/tasks/python.yml index ca92c09..5a815bf 100644 --- a/roles/python_stack/tasks/python.yml +++ b/roles/python_stack/tasks/python.yml @@ -1,21 +1,24 @@ --- - name: Software for dependency installation - dnf: name={{item}} state=installed + dnf: "{{item}}" + state: installed become: yes with_items: - - gcc - - gcc-c++ - - glibc-devel.x86_64 - # - atlas-devel - - python-devel - - lapack-devel - - numpy-f2py - # iminuit - - redhat-rpm-config + - gcc + - gcc-c++ + - glibc-devel.x86_64 + - openssl-devel + # - atlas-devel + - python-devel + - lapack-devel + - numpy-f2py + # iminuit + - redhat-rpm-config when: ansible_distribution == 'Fedora' - name: "Install Python stack for scientific purposes (Distribution)" - package: name={{ item }} state=installed + package: "{{ item }}" + state: installed become: yes with_items: - "{{ python2pkg }}" @@ -27,24 +30,34 @@ register: command_result changed_when: not command_result.stdout.find("Adding setuptools") # not working -- name: upgrade pip2 #install --upgrade pip - pip: state=latest name=pip +- name: upgrade pip2 # install --upgrade pip + pip: + name: pip + state: latest become: yes tags: - skip_ansible_lint - name: install pip packages Python 2 - pip: name={{ item }} state=installed + pip: + name: "{{ item }}" + state: installed become: yes with_items: "{{python2pip}}" - name: upgrade pip3 - pip: executable=pip3 state=latest name=pip + pip: + executable: pip3 + state: latest + name: pip become: yes tags: - skip_ansible_lint - name: install pip packages Python 2 - pip: executable=pip3 name={{ item }} state=installed + pip: + executable: pip3 + name: "{{ item }}" + state: installed become: yes with_items: "{{python3pip}}" -- GitLab