Use systemd module instead of shell
Using ansible systemd module to daemon reload and service reload is the solution for the future. Change-Id: If2e4c74ebf8a28d5a777c404cfcc179db32de3f3
This commit is contained in:
parent
ba7fdf73ed
commit
492e2394d4
@ -13,15 +13,11 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Reload systemd daemon
|
|
||||||
command: "systemctl daemon-reload"
|
|
||||||
notify:
|
|
||||||
- Restart cinder services
|
|
||||||
|
|
||||||
- name: Restart cinder services
|
- name: Restart cinder services
|
||||||
service:
|
systemd:
|
||||||
name: "{{ item.value.service_name }}"
|
name: "{{ item.value.service_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
daemon_reload: yes
|
||||||
with_dict: "{{ cinder_services }}"
|
with_dict: "{{ cinder_services }}"
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups[item.value.group]
|
- inventory_hostname in groups[item.value.group]
|
||||||
|
@ -74,4 +74,4 @@
|
|||||||
- inventory_hostname in groups[item.value.group]
|
- inventory_hostname in groups[item.value.group]
|
||||||
- "{{ item.value.condition | default(true) }}"
|
- "{{ item.value.condition | default(true) }}"
|
||||||
notify:
|
notify:
|
||||||
- Reload systemd daemon
|
- Restart cinder services
|
||||||
|
Loading…
x
Reference in New Issue
Block a user