diff --git a/tasks/lxc_container_config.yml b/tasks/lxc_container_config.yml index 583a2b8..3f2a661 100644 --- a/tasks/lxc_container_config.yml +++ b/tasks/lxc_container_config.yml @@ -17,7 +17,7 @@ - name: Write default container config lineinfile: dest: "/var/lib/lxc/{{ inventory_hostname }}/config" - line: "{{ item }}" + line: "{{ item.split('=', 1)[0] }} = {{ item.split('=', 1)[1] }}" backup: "true" with_items: "{{ lxc_container_default_config_list | union(lxc_container_config_list) }}" delegate_to: "{{ physical_host }}" diff --git a/tests/test-containers-functional.yml b/tests/test-containers-functional.yml index ed7e1e1..a85c86b 100644 --- a/tests/test-containers-functional.yml +++ b/tests/test-containers-functional.yml @@ -37,7 +37,7 @@ - lxc_container_list.stdout is search("container3\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3},\s+)*10.100.100.4(,\s+\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})*\s+") - name: Check for the presence of the right app armor profile for container1 - command: "grep \"^lxc.apparmor.profile={{ (hostvars[physical_host | default('localhost')]['ansible_distribution'] == 'Debian') | ternary('unconfined', 'lxc-openstack') }}$\" {{ item }}" + command: "grep \"^lxc.apparmor.profile = {{ (hostvars[physical_host | default('localhost')]['ansible_distribution'] == 'Debian') | ternary('unconfined', 'lxc-openstack') }}$\" {{ item }}" register: container_profile failed_when: container_profile.rc != 0 with_sequence: start=1 end=3 format=/var/lib/lxc/container%x/config