Changeset - 74b1cab547fc
[Not reviewed]
0 4 0
Branko Majic (branko) - 7 years ago 2017-08-21 14:24:47
branko@majic.rs
MAR-122: Fixed handling of complex package versions for pip with Ansible 2.x:

- Use list for installing specific version of pip in the "pipreqcheck" virtual
environment in common role.
- Removed superficious (and incorrect) definition for application admin username
in wsgi_website role.
- Updated test playbook for wsgi_website role to test the fix.
- Switched to passing-in package list for installing packages in virtual
environment instead of using "with_items" in wsgi_website role.
4 files changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
roles/common/tasks/main.yml
Show inline comments
 
@@ -350,7 +350,8 @@
 

	
 
- name: Install latest pip in pip-tools virtual environment
 
  pip:
 
    name: "pip>=9.0.0,<10.0.0"
 
    name:
 
      - "pip>=9.0.0,<10.0.0"
 
    virtualenv: "~pipreqcheck/virtualenv"
 
  become: yes
 
  become_user: "pipreqcheck"
roles/wsgi_website/defaults/main.yml
Show inline comments
 
@@ -8,7 +8,6 @@ static_locations: []
 
use_paste: False
 
virtualenv_packages: []
 
environment_variables: {}
 
admin: "web-{{ fqdn | replace('.', '_') }}"
 
https_tls_certificate: "{{ lookup('file', tls_certificate_dir + '/' + fqdn + '_https.pem') }}"
 
https_tls_key: "{{ lookup('file', tls_private_key_dir + '/' + fqdn + '_https.key') }}"
 
gunicorn_version: "19.7.1"
roles/wsgi_website/playbook.yml
Show inline comments
 
@@ -89,7 +89,7 @@
 
      uid: 5001
 
      use_paste: no
 
      virtualenv_packages:
 
        - dnspython==1.15.0
 
        - dnspython==1.15.0,<1.20.0
 
        - ptpython==0.41
 
        - prompt-toolkit==1.0.15
 
      website_mail_recipients: user
roles/wsgi_website/tasks/main.yml
Show inline comments
 
@@ -146,10 +146,9 @@
 
  become: yes
 
  become_user: "{{ admin }}"
 
  pip:
 
    name: "{{ item }}"
 
    name: "{{ virtualenv_packages }}"
 
    state: present
 
    virtualenv: "{{ home }}/virtualenv"
 
  with_items: "{{ virtualenv_packages }}"
 
  register: install_additional_packages_in_virtualenv
 
  notify:
 
    - Restart WSGI services
0 comments (0 inline, 0 general)