Skip to content

Commit c4d1751

Browse files
committed
Fix lint errors and warnings
1 parent 236d470 commit c4d1751

File tree

6 files changed

+43
-40
lines changed

6 files changed

+43
-40
lines changed

meta/main.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ galaxy_info:
99
min_ansible_version: 2.7
1010
github_branch: main
1111
platforms:
12-
- name: EL
13-
versions:
14-
- all
15-
- name: Fedora
16-
versions:
17-
- all
18-
- name: Ubuntu
19-
versions:
20-
- all
21-
- name: Debian
22-
versions:
23-
- all
12+
- name: EL
13+
versions:
14+
- all
15+
- name: Fedora
16+
versions:
17+
- all
18+
- name: Ubuntu
19+
versions:
20+
- all
21+
- name: Debian
22+
versions:
23+
- all
2424
galaxy_tags:
25-
- database
26-
- sql
27-
- postgres
28-
- postgresql
25+
- database
26+
- sql
27+
- postgres
28+
- postgresql
2929
dependencies: []

tasks/backup.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
dest: "{{ postgresql_conf_dir }}/conf.d/20ansible_backup.conf"
4747
owner: postgres
4848
group: postgres
49-
backup: yes
49+
mode: 0644
50+
backup: true
5051
notify: Reload PostgreSQL
5152

5253
- name: Schedule backups

tasks/debian.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- name: Install pgdg repository (Debian/pgdg)
1414
apt_repository:
1515
repo: "deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main"
16-
update_cache: yes
16+
update_cache: true
1717
when: postgresql_flavor is defined and postgresql_flavor == "pgdg"
1818

1919
- name: Install PostgreSQL (Debian)

tasks/main.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
state: directory
3636
owner: "{{ postgresql_user_name }}"
3737
group: "{{ postgresql_user_name }}"
38+
mode: 0755
3839

3940
# lineinfile's behavior when `backrefs = True` is very odd. We don't want to overwrite include_dirs if it's already
4041
# properly set, but we don't know the exact format it will be in (with or without '=', with a comment at end of line,
@@ -56,15 +57,15 @@
5657
lineinfile:
5758
line: "include_dir 'conf.d'"
5859
path: "{{ postgresql_conf_dir }}/postgresql.conf"
59-
backup: yes
60+
backup: true
6061
notify: Reload PostgreSQL
6162
when: "postgresql_version is version_compare('9.3', '>=') and __postgresql_include_dir_result is changed"
6263

6364
- name: Include 25ansible_postgresql.conf in postgresql.conf
6465
lineinfile:
6566
line: "include 'conf.d/25ansible_postgresql.conf'"
6667
dest: "{{ postgresql_conf_dir }}/postgresql.conf"
67-
backup: yes
68+
backup: true
6869
notify: Reload PostgreSQL
6970
when: "postgresql_version is version_compare('9.3', '<')"
7071

@@ -74,7 +75,8 @@
7475
dest: "{{ postgresql_conf_dir }}/conf.d/25ansible_postgresql.conf"
7576
owner: "{{ postgresql_user_name }}"
7677
group: "{{ postgresql_user_name }}"
77-
backup: yes
78+
mode: 0644
79+
backup: true
7880
notify: Reload PostgreSQL
7981

8082
- name: Install pg_hba.conf
@@ -84,7 +86,7 @@
8486
owner: "{{ postgresql_user_name }}"
8587
group: "{{ postgresql_user_name }}"
8688
mode: 0400
87-
backup: yes
89+
backup: true
8890
notify: Reload PostgreSQL
8991

9092
- include_tasks: backup.yml
@@ -93,5 +95,5 @@
9395
- name: Ensure PostgreSQL is running
9496
service:
9597
name: "{{ postgresql_service_name }}"
96-
enabled: yes
98+
enabled: true
9799
state: started

tasks/redhat.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
yum:
1212
name: "pgdg-redhat-repo"
1313
register: __postgresql_repo_pkg_installed_result
14-
ignore_errors: yes
14+
ignore_errors: true
1515

1616
- name: Install pgdg repository package (RedHat)
1717
yum:
@@ -25,22 +25,22 @@
2525
delay: 5
2626
when: __postgresql_repo_pkg_installed_result is failed
2727

28-
#- name: Collect installed repos
29-
# yum:
30-
# list: repos
31-
# until: __postgresql_yum_repolist_result is succeeded
32-
# retries: 5
33-
# delay: 5
34-
# register: __postgresql_yum_repolist_result
28+
# - name: Collect installed repos
29+
# yum:
30+
# list: repos
31+
# until: __postgresql_yum_repolist_result is succeeded
32+
# retries: 5
33+
# delay: 5
34+
# register: __postgresql_yum_repolist_result
3535

3636
# Not supported (and no good workaround) until there is a solution for https://github.com/ansible/ansible/issues/41178
37-
#- name: Ensure that only the desired PostgreSQL version's repo is enabled
38-
# yum_repository:
39-
# name: item.repoid
40-
# enabled: "{{ (item.repoid == 'pgdg' ~ __postgresql_version_dotless) if item.repoid.startswith('pgdg') else item.state == 'enabled' }}"
41-
# # "{{ __postgresql_yum_repolist_result.results | selectattr('repoid', 'startswith', 'pgdg') | list }}" would be nice
42-
# # here but alas there is no `startswith` test
43-
# loop: "{{ __postgresql_yum_repolist_result.results }}"
37+
# - name: Ensure that only the desired PostgreSQL version's repo is enabled
38+
# yum_repository:
39+
# name: item.repoid
40+
# enabled: "{{ (item.repoid == 'pgdg' ~ __postgresql_version_dotless) if item.repoid.startswith('pgdg') else item.state == 'enabled' }}"
41+
# # "{{ __postgresql_yum_repolist_result.results | selectattr('repoid', 'startswith', 'pgdg') | list }}" would be nice
42+
# # here but alas there is no `startswith` test
43+
# loop: "{{ __postgresql_yum_repolist_result.results }}"
4444

4545
- name: Install PostgreSQL (RedHat)
4646
yum:

vars/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# maps ansible_* to the pgdg repository package name
44
postgresql_pgdg_families:
5-
#default: redhat
5+
# default: redhat
66
Fedora: fedora
77

88
postgresql_pgdg_shortfamilies:
9-
#default: EL
9+
# default: EL
1010
Fedora: F

0 commit comments

Comments
 (0)