1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00
iiab/roles/2-common/tasks/udev.yml

30 lines
1.1 KiB
YAML
Raw Normal View History

2017-09-20 19:40:36 +00:00
- name: Does systemd-udevd.service exist
stat: path="{{ systemd_location }}/systemd-udevd.service"
register: udev_unit
- name: Copy udevd service to /etc/systemd/system to modify
copy: src={{ systemd_location }}/systemd-udevd.service
dest=/etc/systemd/system/systemd-udevd.service
owner=root
group=root
mode=0644
2017-09-20 22:04:51 +00:00
when: udev_unit.stat.exists is defined and udev_unit.stat.exists
- name: Change MountFlags from slave to shared
lineinfile: backup=no
dest=/etc/systemd/system/systemd-udevd.service
regexp='^MountFlags'
line='MountFlags=shared'
state=present
2017-09-20 22:04:51 +00:00
when: udev_unit.stat.exists is defined and udev_unit.stat.exists
2017-09-27 04:34:49 +00:00
# ubuntu 16.04 comes with ansible 2.0.0.2 -- no systemd module
- name: Ask systemd to recognize the changes
2017-09-27 04:34:49 +00:00
shell: systemctl daemon-reload
when: udev_unit.stat.exists is defined and udev_unit.stat.exists
- name: restart so systemd recognizes the changes
2017-09-27 14:56:34 +00:00
shell: systemctl restart systemd-udevd.service
2017-09-20 22:04:51 +00:00
when: udev_unit.stat.exists is defined and udev_unit.stat.exists