Files
@ b4004db97776
Branch filter:
Location: majic-ansible-roles/testsite/playbooks/roles/wsgihello2/tasks/main.yml - annotation
b4004db97776
1.8 KiB
text/x-yaml
MAR-218: Fix incorrect logic for switching directory:
- No piping can be used (since that would be a subshell and would not
affect the working directory for the remainder of the script run).
- No piping can be used (since that would be a subshell and would not
affect the working directory for the remainder of the script run).
2b3af82bc50e 2b3af82bc50e 2b3af82bc50e 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 2b3af82bc50e 2b3af82bc50e 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 2b3af82bc50e 2b3af82bc50e 2b3af82bc50e 2b3af82bc50e 2b3af82bc50e 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 2b3af82bc50e 2b3af82bc50e 0a435b5ba2cf 2b3af82bc50e 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 2b3af82bc50e 2b3af82bc50e 0a435b5ba2cf 2b3af82bc50e 0a435b5ba2cf 2b3af82bc50e 2b3af82bc50e 2b3af82bc50e 480828d2ad47 2b3af82bc50e 2b3af82bc50e 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 0a435b5ba2cf 2b3af82bc50e 480828d2ad47 | ---
- name: Create directory for storing code
ansible.builtin.file:
dest: "/var/www/wsgireq.{{ testsite_domain }}/code/"
state: directory
owner: "admin-wsgireq_{{ testsite_domain_underscores }}"
group: "web-wsgireq_{{ testsite_domain_underscores }}"
mode: "02750"
- name: Deploy requirements and its source for upgrade checks
ansible.builtin.copy:
src: "{{ item }}"
dest: "/etc/pip_check_requirements_upgrades/wsgireq.{{ testsite_domain }}/{{ item }}"
owner: "root"
group: "pipreqcheck"
mode: "0640"
with_items:
- requirements.in
- requirements.txt
- name: Deploy requirements
ansible.builtin.copy:
src: "requirements.txt"
dest: "/var/www/wsgireq.{{ testsite_domain }}/code/requirements.txt"
owner: "admin-wsgireq_{{ testsite_domain_underscores }}"
group: "web-wsgireq_{{ testsite_domain_underscores }}"
mode: "0640"
- name: Deploy pip-tools
become: true
become_user: "admin-wsgireq_{{ testsite_domain_underscores }}"
ansible.builtin.pip:
name: pip-tools
state: present
virtualenv: "/var/www/wsgireq.{{ testsite_domain }}/virtualenv"
- name: Synchronise virtual environment with requirements file
become: true
become_user: "admin-wsgireq_{{ testsite_domain_underscores }}"
ansible.builtin.command: "'/var/www/wsgireq.{{ testsite_domain }}/virtualenv/bin/exec' pip-sync ~/code/requirements.txt ~/.wsgi_requirements.txt"
register: pip_sync_result
changed_when: "pip_sync_result.stdout != 'Everything up-to-date'"
notify:
- Restart wsgihello2
- name: Deploy WSGI application
ansible.builtin.copy:
src: "hello.wsgi"
dest: "/var/www/wsgireq.{{ testsite_domain }}/code/wsgi.py"
owner: "admin-wsgireq_{{ testsite_domain_underscores }}"
group: "web-wsgireq_{{ testsite_domain_underscores }}"
mode: "0640"
notify:
- Restart wsgihello2
|