diff --git a/roles/2-common/tasks/main.yml b/roles/2-common/tasks/main.yml index 093067148..db436515f 100644 --- a/roles/2-common/tasks/main.yml +++ b/roles/2-common/tasks/main.yml @@ -45,7 +45,6 @@ - include_tasks: net_mods.yml when: not is_debuntu and not is_F18 -- include_tasks: udev.yml - include_tasks: iiab-startup.yml - name: Recording STAGE 2 HAS COMPLETED ========================== diff --git a/roles/2-common/tasks/udev.yml b/roles/2-common/tasks/udev.yml deleted file mode 100644 index 618c414b1..000000000 --- a/roles/2-common/tasks/udev.yml +++ /dev/null @@ -1,41 +0,0 @@ -- 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 - 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 - when: udev_unit.stat.exists is defined and udev_unit.stat.exists - -- name: Add udev-reload.service after all filesystems are available as read-write during boot - template: - src: udev-reload.service - dest: /etc/systemd/system/ - when: udev_unit.stat.exists is defined and udev_unit.stat.exists - -- name: Ask systemd to reread unit files (daemon-reload) and restart so systemd recognizes the changes - systemd: - daemon_reload: yes - name: systemd-udevd - state: restarted - when: udev_unit.stat.exists is defined and udev_unit.stat.exists - -- name: Enable the udev-reload service during boot - systemd: - name: udev-reload - enabled: yes - when: udev_unit.stat.exists is defined and udev_unit.stat.exists diff --git a/roles/2-common/templates/udev-reload.service b/roles/2-common/templates/udev-reload.service deleted file mode 100644 index f1a7f6297..000000000 --- a/roles/2-common/templates/udev-reload.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Make sure udev is operating on RW disk -After=network-online.target - -[Service] -ExecStart=/bin/systemctl restart systemd-udevd.service - -[Install] -WantedBy=multi-user.target diff --git a/roles/usb_lib/tasks/install.yml b/roles/usb_lib/tasks/install.yml index 375b0aa4c..49f5044ef 100644 --- a/roles/usb_lib/tasks/install.yml +++ b/roles/usb_lib/tasks/install.yml @@ -1,3 +1,33 @@ +- 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 + 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 + when: udev_unit.stat.exists is defined and udev_unit.stat.exists + +- name: Ask systemd to reread unit files (daemon-reload) and restart so systemd recognizes the changes + systemd: + daemon_reload: yes + name: systemd-udevd + state: restarted + when: udev_unit.stat.exists is defined and udev_unit.stat.exists + #http://raspbian.raspberrypi.org/raspbian/pool/main/u/usbmount/usbmount_0.0.22_all.deb - name: Install {{ iiab_download_url }}/usbmount_0.0.22_all.deb, missing from Debian apt: