Use policy_rc_d attribute instead of copy

Since ansible 2.8 it's possible to provide policy_rc_d attribute to the
apt module in order to avoid service restart on installation/upgrade

Change-Id: Ida1ce1b767497c792fbb7bcdb934ba5e282041b1
This commit is contained in:
Dmitriy Rabotyagov 2022-09-26 13:28:32 +02:00
parent d37ba4a195
commit c6218267c6
2 changed files with 1 additions and 17 deletions

View File

@ -1,2 +0,0 @@
#!/bin/bash
exit 101

View File

@ -62,14 +62,6 @@
with_items: "{{ galera_debconf_items }}"
no_log: yes
- name: Prevent galera from starting on install
copy:
src: "policy-rc.d"
dest: "/usr/sbin/policy-rc.d"
mode: "0755"
backup: yes
changed_when: false
- name: Update Apt cache
apt:
update_cache: yes
@ -84,6 +76,7 @@
apt:
name: "{{ galera_packages_list }}"
state: "{{ galera_package_state }}"
policy_rc_d: 101
update_cache: yes
cache_valid_time: "{{ cache_timeout }}"
register: install_remote_apt_packages
@ -92,10 +85,3 @@
delay: 2
notify:
- Restart all mysql
- name: Remove policy-rc now that the package install is complete
file:
path: "/usr/sbin/policy-rc.d"
state: absent
changed_when: false