Skip to content

Commit 1342a54

Browse files
eamanuberkerpeksag
authored andcommitted
Avoid deprecated message of the use of apt
When the commando vagrant provision run, currently a deprecated message is printed for `ìnstall base package`: [DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use `name: ['build-essential', 'libpq-dev', 'lib32z1-dev', 'git', 'python3-dev', 'python3-setuptools', 'python3-pip', 'python3-venv', 'ruby']` and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. similar for `Install PostgreSQL`. So this PR propose the use of the recommended command.
1 parent 84b9f27 commit 1342a54

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

provisioning/pythondotorg.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@
1212

1313
- name: Install base packages
1414
become: yes
15-
apt: name={{ item }} state=latest
16-
with_items:
17-
- build-essential
18-
- libpq-dev
19-
- lib32z1-dev
20-
- git
21-
- python3-dev
22-
- python3-setuptools
23-
- python3-pip
24-
- python3-venv
25-
- ruby
15+
apt:
16+
name:
17+
- build-essential
18+
- libpq-dev
19+
- lib32z1-dev
20+
- git
21+
- python3-dev
22+
- python3-setuptools
23+
- python3-pip
24+
- python3-venv
25+
- ruby
26+
state: latest
2627
register: result
2728
changed_when:
2829
"result.stdout is defined and '0 upgraded, 0 newly installed, 0 to remove and' not in result.stdout"
@@ -32,13 +33,14 @@
3233
gem: name=bundler user_install=no
3334

3435
- name: Install PostgreSQL
35-
apt: name={{ item }} state=present
36+
apt:
37+
name:
38+
- postgresql
39+
- postgresql-contrib
40+
- libpq-dev
41+
- python-psycopg2
42+
state: present
3643
become: yes
37-
with_items:
38-
- postgresql
39-
- postgresql-contrib
40-
- libpq-dev
41-
- python-psycopg2
4244

4345
- name: Ensure the PostgreSQL service is running
4446
service: name=postgresql state=started enabled=yes

0 commit comments

Comments
 (0)