From a0b23684a504a8e054b24f0e11c7341fb051bbe8 Mon Sep 17 00:00:00 2001 From: VC Date: Fri, 5 Jul 2024 11:53:33 +0200 Subject: [PATCH] style: make ansible-lint happier --- roles/php/handlers/main.yml | 4 ++-- roles/php/tasks/main.yml | 24 +++++++++++++----------- roles/postfix/handlers/main.yml | 20 ++++++++++++-------- roles/postfix/tasks/main.yml | 28 +++++++++++++++------------- 4 files changed, 42 insertions(+), 34 deletions(-) diff --git a/roles/php/handlers/main.yml b/roles/php/handlers/main.yml index 1aa3beb..4b5be26 100644 --- a/roles/php/handlers/main.yml +++ b/roles/php/handlers/main.yml @@ -1,6 +1,6 @@ --- -- name: restart php-fpm - service: +- name: Restart php-fpm + ansible.builtin.service: name: "php{{ php_version }}-fpm" state: restarted diff --git a/roles/php/tasks/main.yml b/roles/php/tasks/main.yml index eef82b8..eba757f 100644 --- a/roles/php/tasks/main.yml +++ b/roles/php/tasks/main.yml @@ -1,28 +1,30 @@ --- -- name: install php-fpm - package: +- name: Install php-fpm + ansible.builtin.package: name: php-fpm state: present -- name: configure php-fpm - template: +- name: Configure php-fpm + ansible.builtin.template: src: www.conf.j2 dest: /etc/php/{{ php_version }}/fpm/pool.d/www.conf + mode: 0644 notify: - - restart php-fpm + - Restart php-fpm -- name: configure php - template: +- name: Configure php + ansible.builtin.template: src: php.ini.j2 dest: /etc/php/{{ php_version }}/fpm/php.ini + mode: 0644 notify: - - restart php-fpm + - Restart php-fpm -- name: install lib for php - package: +- name: Install lib for php + ansible.builtin.package: name: "php-{{ item }}" state: present loop: "{{ php_modules }}" notify: - - restart php-fpm + - Restart php-fpm diff --git a/roles/postfix/handlers/main.yml b/roles/postfix/handlers/main.yml index a8d9e49..b9c1c2b 100644 --- a/roles/postfix/handlers/main.yml +++ b/roles/postfix/handlers/main.yml @@ -1,14 +1,18 @@ --- -- name: postmap virtual-regexp - command: postmap /etc/postfix/virtual-regexp - listen: "postmap files" +- name: Postmap virtual-regexp + ansible.builtin.command: + cmd: postmap /etc/postfix/virtual-regexp + changed_when: true + listen: "Postmap files" -- name: postmap transport - command: postmap /etc/postfix/transport - listen: "postmap files" +- name: Postmap transport + ansible.builtin.command: + cmd: postmap /etc/postfix/transport + changed_when: true + listen: "Postmap files" -- name: restart postfix - service: +- name: Restart postfix + ansible.builtin.service: name: postfix state: restarted diff --git a/roles/postfix/tasks/main.yml b/roles/postfix/tasks/main.yml index 52280b5..f2b6732 100644 --- a/roles/postfix/tasks/main.yml +++ b/roles/postfix/tasks/main.yml @@ -1,38 +1,40 @@ --- -- name: install postfix - package: +- name: Install postfix + ansible.builtin.package: name: postfix state: present -- name: install mailutils - package: +- name: Install mailutils + ansible.builtin.package: name: mailutils state: present -- name: main configuration files - copy: +- name: Main configuration files + ansible.builtin.copy: src: "./files/{{ item }}" dest: "/etc/postfix/{{ item }}" + mode: 0644 loop: - main.cf - master.cf notify: - - restart postfix + - Restart postfix -- name: map files - copy: +- name: Map files + ansible.builtin.copy: src: "./files/{{ item }}" dest: "/etc/postfix/{{ item }}" + mode: 0644 loop: - transport - virtual-regexp notify: - - postmap files - - restart postfix + - Postmap files + - Restart postfix -- name: mail generation script - copy: +- name: Mail generation script + ansible.builtin.copy: src: ./files/generate_email.sh dest: /usr/local/bin/generate_email.sh owner: root