From e794e1e9d23683458a0a442bbca117cd431b4ab6 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Wed, 20 Sep 2017 11:58:50 -0700 Subject: [PATCH] put in separate file, execute unconditionally --- roles/2-common/tasks/main.yml | 1 + roles/2-common/tasks/net_mods.yml | 26 -------------------------- roles/2-common/tasks/udev.yml | 26 ++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 roles/2-common/tasks/udev.yml diff --git a/roles/2-common/tasks/main.yml b/roles/2-common/tasks/main.yml index 0cd96a665..33a5388da 100644 --- a/roles/2-common/tasks/main.yml +++ b/roles/2-common/tasks/main.yml @@ -42,3 +42,4 @@ - include: net_mods.yml when: not is_debuntu and not is_F18 +- include: udev.yml diff --git a/roles/2-common/tasks/net_mods.yml b/roles/2-common/tasks/net_mods.yml index 8234ebe40..6e550b858 100644 --- a/roles/2-common/tasks/net_mods.yml +++ b/roles/2-common/tasks/net_mods.yml @@ -30,29 +30,3 @@ service: name=wpa_supplicant enabled=no -- 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={{ 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 recognize the changes - systemd: name=systemd-udevd - daemon-reload=True - state=restarted - when: udev_unit.stat.exists is defined and udev_unit stat.exists - diff --git a/roles/2-common/tasks/udev.yml b/roles/2-common/tasks/udev.yml new file mode 100644 index 000000000..979c650c1 --- /dev/null +++ b/roles/2-common/tasks/udev.yml @@ -0,0 +1,26 @@ +- 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={{ 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 recognize the changes + systemd: name=systemd-udevd + daemon-reload=True + state=restarted + when: udev_unit.stat.exists is defined and udev_unit stat.exists +