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:
Cuong Nguyen 2017-01-24 09:51:15 +07:00
parent ba7fdf73ed
commit 492e2394d4
2 changed files with 3 additions and 7 deletions

View File

@ -13,15 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Reload systemd daemon
command: "systemctl daemon-reload"
notify:
- Restart cinder services
- name: Restart cinder services
service:
systemd:
name: "{{ item.value.service_name }}"
state: restarted
daemon_reload: yes
with_dict: "{{ cinder_services }}"
when:
- inventory_hostname in groups[item.value.group]

View File

@ -74,4 +74,4 @@
- inventory_hostname in groups[item.value.group]
- "{{ item.value.condition | default(true) }}"
notify:
- Reload systemd daemon
- Restart cinder services