2017-09-20 19:40:36 +00:00
|
|
|
- name: Does systemd-udevd.service exist
|
2018-02-13 02:35:44 +00:00
|
|
|
stat:
|
|
|
|
path: "{{ systemd_location }}/systemd-udevd.service"
|
2017-09-20 18:58:50 +00:00
|
|
|
register: udev_unit
|
|
|
|
|
|
|
|
- name: Copy udevd service to /etc/systemd/system to modify
|
2018-02-13 02:35:44 +00:00
|
|
|
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
|
2017-09-20 18:58:50 +00:00
|
|
|
|
|
|
|
- name: Change MountFlags from slave to shared
|
2018-02-13 02:35:44 +00:00
|
|
|
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-20 18:58:50 +00:00
|
|
|
|
2017-09-27 04:34:49 +00:00
|
|
|
# ubuntu 16.04 comes with ansible 2.0.0.2 -- no systemd module
|
2018-07-16 20:56:42 +00:00
|
|
|
- name: Ask systemd to reread unit files (daemon-reload)
|
2018-07-16 20:51:39 +00:00
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
when: udev_unit.stat.exists is defined and udev_unit.stat.exists
|
|
|
|
|
2017-10-27 23:17:51 +00:00
|
|
|
- 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
|
2017-09-20 18:58:50 +00:00
|
|
|
|
2017-10-27 23:17:51 +00:00
|
|
|
- name: Reload systemd-udevd so it has rootfs open read-write
|
2018-02-13 02:35:44 +00:00
|
|
|
template:
|
|
|
|
src: udev-reload.service
|
|
|
|
dest: /etc/systemd/system/
|
2017-09-29 23:38:04 +00:00
|
|
|
|
2017-10-27 23:17:51 +00:00
|
|
|
- name: Enable the reload service
|
2017-09-30 16:42:01 +00:00
|
|
|
shell: systemctl enable udev-reload.service
|