Skip to content

Commit

Permalink
Fix ansible lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Jun 3, 2023
1 parent 737f5c9 commit 557410f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
8 changes: 3 additions & 5 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ exclude_paths:
- .github/
- tests
skip_list:
- risky-file-permissions
- risky-file-permissions # Keep default file permission on modification by default
- var-naming[no-role-prefix] # Using "_" or "_*" names for temporary variables
warn_list:
- experimental
- schema[meta]
- name[template]
- galaxy[no-changelog]
- meta-runtime[unsupported-version]
- schema[meta] # Sometime, new Fedora versions are not present in valid schema values
2 changes: 2 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
releases: {}
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
requires_ansible: "~=2.14"
requires_ansible: ">=2.14.0"
8 changes: 4 additions & 4 deletions roles/common/tasks/dnf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
- name: Check if DNF configuration was updated by RPM
ansible.builtin.stat:
path: /etc/dnf/dnf.conf.rpmnew
register: dnf_conf_rpmnew
register: _dnf_conf_rpmnew

- name: Ensure latest DNF configuration from RPM is used
ansible.builtin.copy:
remote_src: true
src: /etc/dnf/dnf.conf.rpmnew
dest: /etc/dnf/dnf.conf
when: dnf_conf_rpmnew.stat.exists
when: _dnf_conf_rpmnew.stat.exists

- name: Ensure DNF is configured
community.general.ini_file:
Expand Down Expand Up @@ -65,14 +65,14 @@
- name: Check if DNF automatic configuration was updated by RPM
ansible.builtin.stat:
path: /etc/dnf/automatic.conf.rpmnew
register: dnf_automatic_conf_rpmnew
register: _dnf_automatic_conf_rpmnew

- name: Ensure latest DNF automatic configuration from RPM is used
ansible.builtin.copy:
remote_src: true
src: /etc/dnf/automatic.conf.rpmnew
dest: /etc/dnf/automatic.conf
when: dnf_automatic_conf_rpmnew.stat.exists
when: _dnf_automatic_conf_rpmnew.stat.exists

- name: Ensure DNF automatic is configured
community.general.ini_file:
Expand Down
10 changes: 5 additions & 5 deletions roles/common/tasks/grub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
- name: Check if Grub default configuration was updated by RPM
ansible.builtin.stat:
path: /etc/default/grub.rpmnew
register: grub_default_rpmnew
register: _grub_default_rpmnew

- name: Ensure latest Grub default configuration from RPM is used
ansible.builtin.copy:
remote_src: true
src: /etc/default/grub.rpmnew
dest: /etc/default/grub
when: grub_default_rpmnew.stat.exists
when: _grub_default_rpmnew.stat.exists

- name: Ensure Grub options are configured
ansible.builtin.lineinfile:
Expand Down Expand Up @@ -42,8 +42,8 @@
install_weak_deps: false
retries: 10
delay: 1
register: pg_python3_pexpect
until: pg_python3_pexpect is successful
register: _pg_python3_pexpect
until: _pg_python3_pexpect is successful
when: common_grub_password is defined

- name: Ensure Grub password is set
Expand All @@ -60,7 +60,7 @@
ansible.builtin.dnf:
state: absent
name: python3-pexpect
when: pg_python3_pexpect.changed # noqa no-handler
when: _pg_python3_pexpect.changed # noqa no-handler

- name: Ensure Grub password is unset
ansible.builtin.file:
Expand Down
6 changes: 3 additions & 3 deletions roles/postgresql/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

- name: Move the database directory from role < 1.3.0 to new the location if required
block:
- name: Ensure the database is not installed directly in "{{ postgresql_data }}" directory
- name: Ensure the database is not installed directly in data directory
ansible.builtin.stat:
path: "{{ postgresql_data }}/PG_VERSION"
register: pg_version_120
failed_when: pg_version_120.stat.exists
rescue:
- name: 'Move the database from "{{ postgresql_data }}" to "{{ _data_subdir }}"'
- name: Move the database to a subdirectory
ansible.builtin.command: "{{ item }}"
args:
creates: "{{ _data_subdir }}/PG_VERSION"
Expand Down Expand Up @@ -82,7 +82,7 @@
name: postgres_socket
state: present

- name: "Ensure {{ postgresql_user }} user is member of postgres_socket group"
- name: Ensure user is member of postgres_socket group
ansible.builtin.user:
name: "{{ postgresql_user }}"
groups: postgres_socket
Expand Down

0 comments on commit 557410f

Please sign in to comment.