diff --git a/tasks/lxc_cache_preparation_systemd_old.yml b/tasks/lxc_cache_preparation_systemd_old.yml index f64e86db..560e6635 100644 --- a/tasks/lxc_cache_preparation_systemd_old.yml +++ b/tasks/lxc_cache_preparation_systemd_old.yml @@ -63,8 +63,8 @@ # the following ML post resolves the bug. # * https://lists.freedesktop.org/archives/systemd-devel/2015-March/029151.html - name: Move machined service into place - copy: - src: systemd-machined.service + template: + src: systemd-machined.service.j2 dest: /etc/systemd/system/systemd-machined.service register: machined_unit when: diff --git a/files/systemd-machined.service b/templates/systemd-machined.service.j2 similarity index 94% rename from files/systemd-machined.service rename to templates/systemd-machined.service.j2 index 5477de85..e948d350 100644 --- a/files/systemd-machined.service +++ b/templates/systemd-machined.service.j2 @@ -13,7 +13,7 @@ Wants=machine.slice After=machine.slice [Service] -ExecStart=/lib/systemd/systemd-machined +ExecStart={{ systemd_utils_prefix }}/systemd-machined BusName=org.freedesktop.machine1 CapabilityBoundingSet=CAP_KILL CAP_SYS_PTRACE CAP_SYS_ADMIN CAP_SETGID CAP_SYS_CHROOT CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_CHOWN CAP_FOWNER CAP_FSETID WatchdogSec=3min diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 97740ac4..4d84fad5 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -14,6 +14,7 @@ # limitations under the License. system_config_dir: "/etc/sysconfig" +systemd_utils_prefix: "/lib/systemd" # Required rpm packages. lxc_hosts_distro_packages: diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index ef5f0a3e..03a23f9e 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -43,6 +43,7 @@ lxc_hosts_distro_packages: lxc_xz_bin: pxz system_config_dir: "/etc/default" +systemd_utils_prefix: "/lib/systemd" lxc_cache_map: distro: ubuntu arch: "{{ lxc_architecture_mapping.get( ansible_architecture ) }}"