|
1 | | -- name: pull repository from Github to project directory |
| 1 | +- name: Pull repository from Github to project directory |
2 | 2 | ansible.builtin.git: |
3 | 3 | accept_hostkey: true |
4 | 4 | dest: "{{ project_root }}" |
|
8 | 8 | become: true |
9 | 9 | when: environment_type != "development" |
10 | 10 | notify: |
11 | | - - restart nginx |
12 | | - - restart gunicorn |
13 | | - - create new Sentry release |
14 | | - - send Sentry notification of deployment |
| 11 | + - Restart nginx |
| 12 | + - Restart gunicorn |
| 13 | + - Create new Sentry release |
| 14 | + - Send Sentry notification of deployment |
15 | 15 |
|
16 | | -- name: install python packages and associated libraries |
| 16 | +- name: Install python packages and associated libraries |
17 | 17 | ansible.builtin.apt: |
18 | 18 | name: |
19 | 19 | - gettext |
|
31 | 31 | - zlib1g-dev |
32 | 32 | state: present |
33 | 33 | become: true |
34 | | - notify: restart gunicorn |
| 34 | + notify: Restart gunicorn |
35 | 35 |
|
36 | | -- name: change ownership of everything to this user |
| 36 | +- name: Change ownership of everything to this user |
37 | 37 | ansible.builtin.file: |
38 | 38 | path: "{{ project_root }}" |
39 | 39 | recurse: true |
40 | 40 | owner: "{{ ansible_user_id }}" |
41 | 41 | group: www-data |
42 | 42 | become: true |
43 | 43 |
|
44 | | -- name: manually figure out latest Git commit |
| 44 | +- name: Manually figure out latest Git commit |
45 | 45 | ansible.builtin.command: git rev-parse HEAD chdir={{ project_root }} |
46 | 46 | register: git_status |
47 | 47 | tags: |
48 | 48 | - skip_ansible_lint |
49 | 49 |
|
50 | | -- name: determine if virtualenv exists |
| 50 | +- name: Determine if virtualenv exists |
51 | 51 | ansible.builtin.stat: |
52 | 52 | path: "{{ virtualenv_root }}/{{ git_status.stdout }}" |
53 | 53 | register: venv_dir |
54 | 54 |
|
55 | | -- name: create virtualenv if necessary |
| 55 | +- name: Create virtualenv if necessary |
56 | 56 | ansible.builtin.command: > |
57 | 57 | python3 -m virtualenv -p python3 {{ virtualenv_root }}/{{ git_status.stdout }} |
58 | 58 | when: venv_dir.stat.isdir is not defined |
59 | | - notify: delete other virtualenvs |
| 59 | + notify: Delete other virtualenvs |
60 | 60 | tags: |
61 | 61 | - skip_ansible_lint |
62 | 62 |
|
63 | | -- name: get target of old "current" virtualenv symlink |
| 63 | +- name: Get target of old "current" virtualenv symlink |
64 | 64 | ansible.builtin.stat: |
65 | 65 | path: "{{ virtualenv_root }}/current" |
66 | 66 | register: old_current_virtualenv |
67 | 67 |
|
68 | | -- name: add/update "previous" virtualenv symlink |
| 68 | +- name: Add/update "previous" virtualenv symlink |
69 | 69 | ansible.builtin.file: |
70 | 70 | path: "{{ virtualenv_root }}/previous" |
71 | 71 | src: "{{ old_current_virtualenv.stat.lnk_source }}" |
72 | 72 | state: link |
73 | 73 | when: venv_dir.stat.isdir is not defined and old_current_virtualenv.stat.islnk is true |
74 | 74 |
|
75 | | -- name: add/update "current" virtualenv symlink |
| 75 | +- name: Add/update "current" virtualenv symlink |
76 | 76 | ansible.builtin.file: |
77 | 77 | state: link |
78 | 78 | path: "{{ virtualenv_root }}/current" |
79 | 79 | src: "{{ virtualenv_root }}/{{ git_status.stdout }}" |
80 | 80 |
|
81 | | -- name: use symlink for easier virtualenv management |
| 81 | +- name: Use symlink for easier virtualenv management |
82 | 82 | ansible.builtin.file: |
83 | 83 | path: "{{ virtualenv_root }}/current" |
84 | 84 | src: "{{ virtualenv_root }}/{{ git_status.stdout }}" |
85 | 85 | state: link |
86 | 86 |
|
87 | | -- name: install latest version of pip |
| 87 | +- name: Install latest version of pip |
88 | 88 | ansible.builtin.pip: |
89 | 89 | extra_args: "--upgrade" |
90 | 90 | name: pip |
91 | 91 | state: present |
92 | 92 | virtualenv: "{{ virtualenv_root }}/current" |
93 | 93 |
|
94 | | -- name: update virtualenv with requirements |
| 94 | +- name: Update virtualenv with requirements |
95 | 95 | ansible.builtin.pip: |
96 | 96 | extra_args: "--upgrade" |
97 | 97 | requirements: "{{ project_root }}/requirements/{{ environment_type }}.txt" |
98 | 98 | state: present |
99 | 99 | virtualenv: "{{ virtualenv_root }}/current" |
100 | | - notify: restart gunicorn |
| 100 | + notify: Restart gunicorn |
101 | 101 |
|
102 | | -- name: add supervisor configuration file for gunicorn |
| 102 | +- name: Add supervisor configuration file for gunicorn |
103 | 103 | ansible.builtin.template: |
104 | 104 | dest: "/etc/supervisor/conf.d/gunicorn.conf" |
105 | 105 | mode: 0644 |
106 | 106 | src: supervisor.conf |
107 | 107 | become: true |
108 | 108 | notify: |
109 | | - - restart supervisor |
110 | | - - restart gunicorn |
| 109 | + - Restart supervisor |
| 110 | + - Restart gunicorn |
0 commit comments