浏览代码

Update install_packages.yml

Signed-off-by: abhishek-sa1 <abhishek.sa3@dell.com>
abhishek-sa1 3 年之前
父节点
当前提交
d29d464894
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      control_plane/roles/control_plane_security/tasks/install_packages.yml

+ 8 - 8
control_plane/roles/control_plane_security/tasks/install_packages.yml

@@ -23,19 +23,19 @@
   copy:
     src: "{{ resolv_conf_path }}"
     dest: "{{ temp_resolv_conf_path }}"
-    mode: "{{ resolv_file_mode }}"
+    mode: "{{ file_mode }}"
     remote_src: yes
 
 - name: Add the domain name in /etc/resolv.conf
-  replace:
+  lineinfile:
     path: "{{ temp_resolv_conf_path }}"
-    regexp: "search"
-    replace: "search {{ domain_name }}"
+    regexp: "^search"
+    line: "search {{ domain_name }}"
   register: replace_output
 
 - name: Add the domain name in /etc/resolv.conf when there is no domain name
-  replace:
+  lineinfile:
     path: "{{ temp_resolv_conf_path }}"
-    regexp: "# Generated by NetworkManager"
-    replace: "# Generated by NetworkManager\nsearch {{ domain_name }}"
-  when: replace_output.msg | length == 0
+    insertafter: "^# Generated by NetworkManager"
+    line: "search {{ domain_name }}"
+  when: replace_output.msg | length == 0