1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/2-common/tasks/udev.yml

41 lines
1.3 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
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-10-27 23:17:51 +00:00
- name: Reload systemd-udevd so it has rootfs open read-write
template:
src: udev-reload.service
dest: /etc/systemd/system/
2017-10-27 23:17:51 +00:00
- name: Enable the reload service
shell: systemctl enable udev-reload.service