diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index 98d22594d..ac8bde457 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -80,27 +80,17 @@ - include: detected_network.yml when: not installing -# Patch Fedora 21+ so usbmount works -# Set flag to True that was initialized to False in role defaults -# We can't undo this -- name: Does udev need patching - set_fact: - udev_needs_patch: True - when: ansible_distribution == "Fedora" and ansible_distribution_version >= "21" - -# Same patch for CentOS 7.2 -- name: Does udev need patching for Centos - set_fact: - udev_needs_patch: True - when: ansible_distribution == "CentOS" and ansible_distribution_version >= "7.2.1511" +- name: Does systemd-udevd.service exist + stat: "{{ systemd_location }}/systemd-udevd.service" + register: udev_unit - name: Copy udevd service to /etc/systemd/system to modify - copy: src=/usr/lib/systemd/system/systemd-udevd.service + copy: src={{ systemd_location }}/systemd-udevd.service dest=/etc/systemd/system/systemd-udevd.service owner=root group=root mode=0644 - when: udev_needs_patch + when: udev_unit.stat.exists is defined and udev_unit stat.exists - name: Change MountFlags from slave to shared lineinfile: backup=no @@ -108,12 +98,13 @@ regexp='^MountFlags' line='MountFlags=shared' state=present - when: udev_needs_patch + when: udev_unit.stat.exists is defined and udev_unit stat.exists -- name: Restart systemd-udevd.service - service: name=systemd-udevd +- name: Ask systemd to recognize the changes + systemd: name=systemd-udevd + daemon-reload=True state=restarted - when: udev_needs_patch and not installing + when: udev_unit.stat.exists is defined and udev_unit stat.exists # Put conditional actions for hardware platforms here diff --git a/vars/centos-7.yml b/vars/centos-7.yml index 4382282fb..f852434f6 100644 --- a/vars/centos-7.yml +++ b/vars/centos-7.yml @@ -16,3 +16,4 @@ apache_log: /var/log/httpd/access_log sshd_service: sshd php_version: 7.0 postgresql_version: 9.5 +systemd_location: /usr/lib/systemd/system diff --git a/vars/debian-8.yml b/vars/debian-8.yml index 9afa5642d..bf15b534b 100644 --- a/vars/debian-8.yml +++ b/vars/debian-8.yml @@ -20,3 +20,4 @@ cups_install: True sshd_service: ssh php_version: 5 postgresql_version: 9.4 +systemd_location: /lib/systemd/system diff --git a/vars/debian-9.yml b/vars/debian-9.yml index 5f57aceba..1e1697783 100644 --- a/vars/debian-9.yml +++ b/vars/debian-9.yml @@ -20,5 +20,6 @@ cups_install: True sshd_service: ssh php_version: 7.0 postgresql_version: 9.6 +systemd_location: /lib/systemd/system diff --git a/vars/fedora-18.yml b/vars/fedora-18.yml index e285b24a8..db8395fe9 100644 --- a/vars/fedora-18.yml +++ b/vars/fedora-18.yml @@ -17,3 +17,4 @@ php_version: 5 sshd_service: sshd nextcloud_install: False nextcloud_enabled: False +systemd_location: /usr/lib/systemd/system diff --git a/vars/fedora-22.yml b/vars/fedora-22.yml index 3330995f0..f12a394c2 100644 --- a/vars/fedora-22.yml +++ b/vars/fedora-22.yml @@ -13,3 +13,4 @@ systemctl_program: /usr/bin/systemctl mysql_service: mariadb apache_log: /var/log/httpd/access_log sshd_service: sshd +systemd_location: /usr/lib/systemd/system diff --git a/vars/raspbian-8.yml b/vars/raspbian-8.yml index 66df85cd2..0a61c04a1 100644 --- a/vars/raspbian-8.yml +++ b/vars/raspbian-8.yml @@ -22,3 +22,4 @@ cups_install: True sshd_service: ssh php_version: 5 postgresql_version: 9.4 +systemd_location: /lib/systemd/system diff --git a/vars/raspbian-9.yml b/vars/raspbian-9.yml index 36b385738..e18c339da 100644 --- a/vars/raspbian-9.yml +++ b/vars/raspbian-9.yml @@ -22,3 +22,4 @@ cups_install: False sshd_service: ssh php_version: 7.0 postgresql_version: 9.6 +systemd_location: /lib/systemd/system diff --git a/vars/ubuntu-16.yml b/vars/ubuntu-16.yml index a81773440..1971d5a18 100644 --- a/vars/ubuntu-16.yml +++ b/vars/ubuntu-16.yml @@ -19,3 +19,4 @@ cups_install: True sshd_service: ssh php_version: 7.0 postgresql_version: 9.5 +systemd_location: /lib/systemd/system