Skip to content

Commit 915d445

Browse files
committed
Merge #1234 (ansible linting improvements)
2 parents a4d809d + cf10f05 commit 915d445

File tree

14 files changed

+80
-80
lines changed

14 files changed

+80
-80
lines changed

ansible/roles/common/handlers/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
- name: restart fail2ban
1+
- name: Restart fail2ban
22
ansible.builtin.service:
33
name: fail2ban
44
state: restarted
55
become: true
66

7-
- name: restart supervisor
7+
- name: Restart supervisor
88
ansible.builtin.service:
99
name: supervisor
1010
state: restarted

ansible/roles/common/tasks/apt.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
- name: install python3-apt
1+
- name: Install python3-apt
22
ansible.builtin.apt:
33
pkg: python3-apt
44
state: present
55
become: true
66

7-
- name: update package list & upgrade existing packages
7+
- name: Update package list & upgrade existing packages
88
ansible.builtin.apt:
99
cache_valid_time: 3600
1010
update_cache: true
1111
upgrade: true
1212
become: true
1313

14-
- name: install common packages
14+
- name: Install common packages
1515
ansible.builtin.apt:
1616
name:
1717
- git
@@ -25,14 +25,14 @@
2525
state: present
2626
become: true
2727

28-
- name: copy apt configuration file (20auto-upgrades)
28+
- name: Copy apt configuration file (20auto-upgrades)
2929
ansible.builtin.template:
3030
dest: "/etc/apt/apt.conf.d/20auto-upgrades"
3131
mode: 0644
3232
src: 20auto-upgrades
3333
become: true
3434

35-
- name: copy apt configuration file (50unattended-upgrades)
35+
- name: Copy apt configuration file (50unattended-upgrades)
3636
ansible.builtin.template:
3737
dest: "/etc/apt/apt.conf.d/50unattended-upgrades"
3838
mode: 0644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
- include: apt.yml
2-
- include: security.yml
1+
- import_tasks: apt.yml
2+
- import_tasks: security.yml

ansible/roles/common/tasks/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- name: install fail2ban
1+
- name: Install fail2ban
22
ansible.builtin.apt:
33
pkg: fail2ban
44
state: present

ansible/roles/db/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- name: install PostgreSQL packages
1+
- name: Install PostgreSQL packages
22
ansible.builtin.apt:
33
name:
44
- libpq-dev
@@ -7,7 +7,7 @@
77
state: present
88
become: true
99

10-
- name: create a PostgreSQL database for this project
10+
- name: Create a PostgreSQL database for this project
1111
become: true
1212
become_user: postgres
1313
ansible.builtin.postgresql_db:
@@ -16,7 +16,7 @@
1616
state: present
1717
template: template0
1818

19-
- name: create a PostgreSQL user for this project
19+
- name: Create a PostgreSQL user for this project
2020
become: true
2121
become_user: postgres
2222
ansible.builtin.postgresql_user:
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
- name: restart redis
1+
- name: Restart redis
22
ansible.builtin.service:
33
name: redis-server
44
state: restarted
55
become: true
66

7-
- name: restart nginx
7+
- name: Restart nginx
88
ansible.builtin.service:
99
name: nginx
1010
state: restarted
1111
become: true
1212

13-
- name: delete other virtualenvs
13+
- name: Delete other virtualenvs
1414
ansible.builtin.shell: find -maxdepth 1
1515
! -path '.'
1616
! -path './'$(basename $(readlink current))
@@ -19,18 +19,18 @@
1919
args:
2020
chdir: "{{ virtualenv_root }}"
2121

22-
- name: restart gunicorn
22+
- name: Restart gunicorn
2323
ansible.builtin.supervisorctl:
2424
name: gunicorn
2525
state: restarted
2626
become: true
2727

28-
- name: mark fixtures as applied
28+
- name: Mark fixtures as applied
2929
ansible.builtin.file:
3030
path: "{{ project_root }}/fixtures/.applied"
3131
state: touch
3232
mode: 0600
3333
tags:
3434
- fixtures
3535

36-
- include: sentry.yml
36+
- import_tasks: sentry.yml

ansible/roles/web/handlers/sentry.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- name: create new Sentry release
1+
- name: Create new Sentry release
22
ansible.builtin.uri:
33
body: "{'projects': ['{{ sentry_project_name }}'], 'version': '{{ git_status.stdout }}'}"
44
body_format: "json"
@@ -9,7 +9,7 @@
99
status_code: 201, 208
1010
url: "https://sentry.io/api/0/organizations/{{ application_owner }}/releases/"
1111

12-
- name: send Sentry notification of deployment
12+
- name: Send Sentry notification of deployment
1313
ansible.builtin.uri:
1414
body: "{'environment': '{{ environment_type }}'}"
1515
body_format: "json"

ansible/roles/web/tasks/django.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- name: pull repository from Github to project directory
1+
- name: Pull repository from Github to project directory
22
ansible.builtin.git:
33
accept_hostkey: true
44
dest: "{{ project_root }}"
@@ -8,12 +8,12 @@
88
become: true
99
when: environment_type != "development"
1010
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
1515

16-
- name: install python packages and associated libraries
16+
- name: Install python packages and associated libraries
1717
ansible.builtin.apt:
1818
name:
1919
- gettext
@@ -31,80 +31,80 @@
3131
- zlib1g-dev
3232
state: present
3333
become: true
34-
notify: restart gunicorn
34+
notify: Restart gunicorn
3535

36-
- name: change ownership of everything to this user
36+
- name: Change ownership of everything to this user
3737
ansible.builtin.file:
3838
path: "{{ project_root }}"
3939
recurse: true
4040
owner: "{{ ansible_user_id }}"
4141
group: www-data
4242
become: true
4343

44-
- name: manually figure out latest Git commit
44+
- name: Manually figure out latest Git commit
4545
ansible.builtin.command: git rev-parse HEAD chdir={{ project_root }}
4646
register: git_status
4747
tags:
4848
- skip_ansible_lint
4949

50-
- name: determine if virtualenv exists
50+
- name: Determine if virtualenv exists
5151
ansible.builtin.stat:
5252
path: "{{ virtualenv_root }}/{{ git_status.stdout }}"
5353
register: venv_dir
5454

55-
- name: create virtualenv if necessary
55+
- name: Create virtualenv if necessary
5656
ansible.builtin.command: >
5757
python3 -m virtualenv -p python3 {{ virtualenv_root }}/{{ git_status.stdout }}
5858
when: venv_dir.stat.isdir is not defined
59-
notify: delete other virtualenvs
59+
notify: Delete other virtualenvs
6060
tags:
6161
- skip_ansible_lint
6262

63-
- name: get target of old "current" virtualenv symlink
63+
- name: Get target of old "current" virtualenv symlink
6464
ansible.builtin.stat:
6565
path: "{{ virtualenv_root }}/current"
6666
register: old_current_virtualenv
6767

68-
- name: add/update "previous" virtualenv symlink
68+
- name: Add/update "previous" virtualenv symlink
6969
ansible.builtin.file:
7070
path: "{{ virtualenv_root }}/previous"
7171
src: "{{ old_current_virtualenv.stat.lnk_source }}"
7272
state: link
7373
when: venv_dir.stat.isdir is not defined and old_current_virtualenv.stat.islnk is true
7474

75-
- name: add/update "current" virtualenv symlink
75+
- name: Add/update "current" virtualenv symlink
7676
ansible.builtin.file:
7777
state: link
7878
path: "{{ virtualenv_root }}/current"
7979
src: "{{ virtualenv_root }}/{{ git_status.stdout }}"
8080

81-
- name: use symlink for easier virtualenv management
81+
- name: Use symlink for easier virtualenv management
8282
ansible.builtin.file:
8383
path: "{{ virtualenv_root }}/current"
8484
src: "{{ virtualenv_root }}/{{ git_status.stdout }}"
8585
state: link
8686

87-
- name: install latest version of pip
87+
- name: Install latest version of pip
8888
ansible.builtin.pip:
8989
extra_args: "--upgrade"
9090
name: pip
9191
state: present
9292
virtualenv: "{{ virtualenv_root }}/current"
9393

94-
- name: update virtualenv with requirements
94+
- name: Update virtualenv with requirements
9595
ansible.builtin.pip:
9696
extra_args: "--upgrade"
9797
requirements: "{{ project_root }}/requirements/{{ environment_type }}.txt"
9898
state: present
9999
virtualenv: "{{ virtualenv_root }}/current"
100-
notify: restart gunicorn
100+
notify: Restart gunicorn
101101

102-
- name: add supervisor configuration file for gunicorn
102+
- name: Add supervisor configuration file for gunicorn
103103
ansible.builtin.template:
104104
dest: "/etc/supervisor/conf.d/gunicorn.conf"
105105
mode: 0644
106106
src: supervisor.conf
107107
become: true
108108
notify:
109-
- restart supervisor
110-
- restart gunicorn
109+
- Restart supervisor
110+
- Restart gunicorn

ansible/roles/web/tasks/letsencrypt.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
- name: install certbot
1+
- name: Install certbot
22
ansible.builtin.apt:
33
name: certbot
44
state: present
55
become: true
66
when: ssl_enabled
77

8-
- name: create .well-known directory
8+
- name: Create .well-known directory
99
ansible.builtin.file:
1010
mode: 0755
1111
path: "{{ project_root }}/.well-known"
@@ -16,7 +16,7 @@
1616
# We use the "standalone" method because nginx needs a certificate to run,
1717
# so the webroot method will not work when we provision the certificate for
1818
# the first time.
19-
- name: run certbot and generate certificate
19+
- name: Run certbot and generate certificate
2020
ansible.builtin.command: >
2121
certbot certonly -n --standalone --agree-tos
2222
-d {{ website_domain }}

ansible/roles/web/tasks/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
- include: redis.yml
2-
- include: nginx.yml
3-
- include: letsencrypt.yml
4-
- include: django.yml
5-
- include: pretalx.yml
1+
- import_tasks: redis.yml
2+
- import_tasks: nginx.yml
3+
- import_tasks: letsencrypt.yml
4+
- import_tasks: django.yml
5+
- import_tasks: pretalx.yml

0 commit comments

Comments
 (0)