소스 검색

Merge pull request #867 from Shubhangi-dell/bugfix

Setting docker OS version
Sujit Jadhav 3 년 전
부모
커밋
ac209a4b80

+ 4 - 0
control_plane/roles/control_plane_common/tasks/main.yml

@@ -24,6 +24,10 @@
   import_tasks: package_installation.yml
   tags: init
 
+- name: Set the docker os version
+  import_tasks: set_docker_os.yml
+  tags: init
+  
 - name: Basic configuration
   import_tasks: fetch_base_inputs.yml
 

+ 39 - 0
control_plane/roles/control_plane_common/tasks/set_docker_os.yml

@@ -0,0 +1,39 @@
+#  Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+---
+
+- name: Replace the rocky os version in dockerfile
+  replace:
+    path: "{{ item.path }}"
+    regexp: '^FROM rockylinux/rockylinux:docker_os'
+    replace: 'FROM rockylinux/rockylinux:{{ docker_rocky_os_version }}'
+  with_items:
+    - { path: "{{ cobbler_rocky_dockerfile_path }}"}
+    - { path: "{{ ib_dockerfile_path }}"}
+
+- name: Replace the leap os version in dockerfile
+  replace:
+    path: "{{ item.path }}"
+    regexp: '^FROM registry.opensuse.org/opensuse/leap:docker_os'
+    replace: 'FROM registry.opensuse.org/opensuse/leap:{{ docker_leap_os_version }}'
+  with_items:
+    - { path: "{{ cobbler_leap_dockerfile_path }}"}
+
+- name: Replace the alpine os version in dockerfile
+  replace:
+    path: "{{ item.path }}"
+    regexp: '^FROM alpine:docker_os'
+    replace: 'FROM alpine:{{ docker_alpine_os_version }}'
+  with_items:
+    - { path: "{{ mgmnt_dockerfile_path }}"}

+ 9 - 0
control_plane/roles/control_plane_common/vars/main.yml

@@ -40,6 +40,15 @@ common_packages_rocky:
   - device-mapper-persistent-data
   - yum-plugin-versionlock
 
+# Usage: set_docker_os.yml
+docker_rocky_os_version: "8"
+docker_leap_os_version: "15.3"
+docker_alpine_os_version: "3.15"
+cobbler_rocky_dockerfile_path: "{{ playbook_dir }}/roles/provision_cobbler/files/Dockerfile_rocky"
+cobbler_leap_dockerfile_path: "{{ playbook_dir }}/roles/provision_cobbler/files/Dockerfile_leap"
+ib_dockerfile_path: "{{ playbook_dir }}/roles/control_plane_ib/files/Dockerfile"
+mgmnt_dockerfile_path: "{{ playbook_dir }}/roles/control_plane_device/files/Dockerfile"
+
 # Usage: pre_requisite.yml
 internet_delay: 0
 internet_timeout: 10

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

@@ -1,5 +1,5 @@
 # Dockerfile for creating the management network container
-FROM alpine:latest
+FROM alpine:docker_os
 
 #Installing packages
 RUN apk add dhcp

+ 1 - 1
control_plane/roles/control_plane_ib/files/Dockerfile

@@ -1,4 +1,4 @@
-FROM rockylinux/rockylinux:8.5
+FROM rockylinux/rockylinux:docker_os
 
 RUN dnf install -y epel-release
 RUN dnf install dhcp-server -y \

+ 1 - 1
control_plane/roles/control_plane_ib/files/infiniband_container_configure.yml

@@ -1,4 +1,4 @@
- Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.

+ 2 - 2
control_plane/roles/provision_cobbler/files/Dockerfile_leap

@@ -1,4 +1,4 @@
-FROM registry.opensuse.org/opensuse/leap:15.3
+FROM registry.opensuse.org/opensuse/leap:docker_os
 
 #Enable all repose
 RUN zypper mr -ea
@@ -67,4 +67,4 @@ VOLUME [ "/srv/www/cobbler", "/var/lib/cobbler/backup", "/mnt" ]
 
 RUN systemctl enable dhcpd
 
-CMD ["sbin/init"]
+CMD ["sbin/init"]

+ 2 - 2
control_plane/roles/provision_cobbler/files/Dockerfile_rocky

@@ -1,4 +1,4 @@
-FROM rockylinux/rockylinux:8.5
+FROM rockylinux/rockylinux:docker_os
 
 # RPM REPOs
 RUN dnf install -y \
@@ -66,4 +66,4 @@ VOLUME [ "/var/www/cobbler", "/var/lib/cobbler/backup", "/mnt" ]
 
 RUN systemctl enable dhcpd
 
-CMD ["sbin/init"]
+CMD ["sbin/init"]