Browse Source

Merge pull request #1014 from abhishek-sa1/omnia_changes

Issue #1008: Added netaddr package in management network container
Sujit Jadhav 3 years ago
parent
commit
dd73e924aa

+ 1 - 0
control_plane/roles/control_plane_device/files/Dockerfile

@@ -5,6 +5,7 @@ FROM alpine:docker_os
 RUN apk add dhcp
 RUN apk add ansible
 RUN apk add openrc
+RUN apk add py3-netaddr
 
 #Creation of directories and files
 RUN mkdir /root/omnia

+ 1 - 6
control_plane/roles/control_plane_device/files/inventory_creation.yml

@@ -16,12 +16,7 @@
 - hosts: localhost
   connection: local
   gather_facts: false
-  tasks:
-    - name: Install python-netaddr
-      package:
-        name: py3-netaddr
-        state: present  
-  
+  tasks:  
     - name: Read dhcp file
       set_fact:
         var: "{{ lookup('file', '/var/lib/dhcp/dhcpd.leases').split()| unique | select| list }}"

+ 8 - 0
control_plane/roles/control_plane_security/tasks/main.yml

@@ -14,6 +14,10 @@
 ---
 
 - block:
+    - name: Update resolv.conf to edit mode
+      command: chattr -i "{{ resolv_conf_path }}"
+      changed_when: true
+
     - block:
         - name: Check freeipa installed or not
           include_tasks: check_prerequisites.yml
@@ -63,4 +67,8 @@
     - name: Restrict nonessential programs
       include_tasks: restrict_nonessentials.yml
       when: restrict_program_status
+    
+    - name: Update resolv.conf to read mode
+      command: chattr +i "{{ resolv_conf_path }}"
+      changed_when: true
   when: enable_security_support