Browse Source

Rocky container changes

Signed-off-by: abhishek-sa1 <abhishek.sa3@dell.com>
abhishek-sa1 3 năm trước cách đây
mục cha
commit
d538d8fdab

+ 5 - 0
control_plane/roles/control_plane_common/tasks/fetch_base_inputs.yml

@@ -174,6 +174,11 @@
     success_msg: "{{ success_awx_organization }}"
     fail_msg: "{{ fail_awx_organization }}"
 
+- name: Convert timezone.txt to linux format
+  command: dos2unix {{ role_path }}/files/timezone.txt
+  failed_when: false
+  changed_when: false
+
 - name: Check timezone file
   command: grep -Fx "{{ timezone }}" {{ role_path }}/files/timezone.txt
   failed_when: false

+ 3 - 3
control_plane/roles/control_plane_customiso/tasks/check_prerequisites.yml

@@ -23,8 +23,8 @@
   command: ansible-galaxy collection install {{ item }}
   changed_when: true
   with_items:
-   - community.general
-   - dellemc.openmanage
+   - community.general:4.4.0
+   - dellemc.openmanage:4.4.0
 
 - name: Install omsdk using pip
   pip:
@@ -50,4 +50,4 @@
     path: "{{ role_path }}/../provision_idrac/files/{{ management_station_ip_file }}"
     line: "{{ mngmnt_network_ip }}"
     mode: "{{ file_permission }}"
-    create: yes
+    create: yes

+ 8 - 2
control_plane/roles/control_plane_customiso/tasks/create_unattended_iso.yml

@@ -45,10 +45,16 @@
 
 - name: ISO creation - rocky
   block:
+
+    - name: Fetch rocky profile name
+      shell: set -o pipefail && grep 'Rocky-8' {{ tmp_iso_dir }}{{ grub_cfg_path }} | head -1
+      register: rocky_profile_name
+      changed_when: false
+
     - name: Create custom ISO
       command: >-
         mkisofs -o /tmp/{{ rocky_iso_filename }} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4
-        -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -J -R -V "Rocky-8-4-x86_64-dvd"  {{ tmp_iso_dir }}
+        -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -J -R -V {{ rocky_profile_name.stdout.split(' ')[4] | replace("'","") }}  {{ tmp_iso_dir }}
       changed_when: true
       register: rocky_iso_status
       tags: install
@@ -77,4 +83,4 @@
   file:
     path: "{{ role_path }}/files/{{ idrac_kickstart_file }}"
     state: absent
-  tags: install
+  tags: install

+ 2 - 4
control_plane/roles/control_plane_device/files/Dockerfile

@@ -1,6 +1,5 @@
 # Dockerfile for creating the management network container
-
-FROM centos:8
+FROM rockylinux/rockylinux:8.5
 
 # RPM REPOs
 RUN dnf install -y \
@@ -10,7 +9,6 @@ RUN dnf install -y \
 
 RUN dnf install -y dhcp-server
 RUN dnf install -y python3-netaddr
-
 RUN yum install -y \
   ansible \
   cronie \
@@ -32,4 +30,4 @@ COPY mngmnt_container_configure.yml /root/
 RUN systemctl enable tftp
 RUN systemctl enable dhcpd
 
-CMD ["sbin/init"]
+CMD ["sbin/init"]

+ 2 - 4
control_plane/roles/control_plane_ib/files/Dockerfile

@@ -1,13 +1,11 @@
 # Dockerfile for creating the management network container
-
-FROM centos:8
+FROM rockylinux/rockylinux:8.5
 
 # RPM REPOs
 RUN dnf install -y \
     epel-release \
     && dnf clean all \
     && rm -rf /var/cache/dnf
-
 RUN dnf install dhcp-server -y
 RUN yum install -y \
   ansible \
@@ -23,4 +21,4 @@ COPY dhcpd.conf  /etc/dhcp/dhcpd.conf
 
 RUN systemctl enable dhcpd
 
-CMD ["sbin/init"]
+CMD ["sbin/init"]

+ 1 - 5
control_plane/roles/control_plane_sm/files/Dockerfile

@@ -1,15 +1,11 @@
-FROM centos:8
+FROM rockylinux/rockylinux:8.5
 
 RUN dnf -y update && dnf clean all
-
 RUN dnf install -y epel-release
-
 RUN dnf groupinstall "Infiniband Support" -y
-
 RUN dnf install -y opensm
 
 COPY opensm.conf /etc/rdma/opensm.conf
-
 COPY start.sh /
 
 RUN chmod +x /start.sh

+ 5 - 12
control_plane/roles/provision_cobbler/files/Dockerfile

@@ -1,21 +1,11 @@
-FROM centos:8.3.2011
+FROM rockylinux/rockylinux:8.5
 
-# RPM REPOs
 RUN dnf install -y \
     epel-release \
     && dnf clean all \
     && rm -rf /var/cache/dnf
 
-RUN dnf update -y \
-    && dnf clean all \
-    && rm -rf /var/cache/dnf
-
-RUN dnf install -y git
-RUN git clone -b v3.2.2 https://github.com/cobbler/cobbler.git
-RUN cd cobbler/
-
 RUN mkdir /root/omnia
-
 RUN dnf install -y mod_ssl \
         python3-librepo \
         python3-schema \
@@ -44,11 +34,14 @@ RUN dnf install -y mod_ssl \
         && dnf clean all \
         &&  rm -rf /var/cache/dnf
 
-RUN yum install -y  grub2-efi-x64 shim-x64 
+RUN yum install -y  grub2-efi-x64 shim-x64
 RUN yum install -y yum-utils
 RUN dnf config-manager --set-enabled powertools
 RUN dnf install -y python3-sphinx
 RUN pip3 install wheel
+RUN dnf module enable -y cobbler
+RUN dnf install -y cobbler
+RUN dnf install -y cobbler-web
 
 #Copy Configuration files
 COPY settings.yaml /etc/cobbler/settings.yaml

+ 2 - 25
control_plane/roles/provision_cobbler/files/cobbler_configurations.yml

@@ -22,18 +22,6 @@
     debug:
       msg: "Hiii! I am cobbler"
 
-  - name: Make
-    command: make rpms
-    args:
-      chdir: /cobbler
-    changed_when: false
-
-  - name: Install cobbler and cobbler-web
-    command: dnf install -y cobbler-3.2.2-1.el8.noarch.rpm cobbler-web-3.2.2-1.el8.noarch.rpm
-    args:
-      chdir: /cobbler/rpm-build
-    changed_when: false
-  
   - name: Run script
     shell: sh ./mkgrub.sh
     args:
@@ -49,18 +37,6 @@
         LoadModule wsgi_module modules/mod_wsgi_python3.so
         LoadModule proxy_module modules/mod_proxy.so
 
-  - name: Cobbler web
-    blockinfile:
-      state: present
-      insertafter: '^<VirtualHost '
-      path: /etc/httpd/conf.d/cobbler_web.conf
-      block: |
-         ServerName localhost
-         SSLEngine on
-         SSLCipherSuite PROFILE=SYSTEM
-         SSLCertificateFile /etc/pki/tls/certs/localhost.crt
-         SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
-
   - name: Add settings to http
     shell: echo "LoadModule wsgi_module modules/mod_wsgi_python3.so" >/etc/httpd/conf.d/wsgi.conf
     changed_when: false
@@ -90,6 +66,7 @@
 
   - name: Adding curl
     shell: export PATH="/usr/bin/curl:$PATH"
+    changed_when: false
 
   - name: Run import command
     command: cobbler import --arch=x86_64 --path=/mnt --name="{{ name_iso }}"
@@ -134,7 +111,7 @@
 
   - name: Syncing of cobbler
     command: cobbler sync
-    changed_when: false 
+    changed_when: false
 
   - name: Restart cobblerd, http, xinetd and dhcpd
     service:

+ 6 - 3
control_plane/roles/webui_awx/files/requirements.yml

@@ -1,5 +1,8 @@
 ---
 collections:
-  - community.general
-  - dellemc.openmanage
-  - dellemc.os10
+  - name: community.general
+    version: 4.4.0
+  - name: dellemc.openmanage
+    version: 4.4.0
+  - name: dellemc.os10
+    version: 1.1.1

+ 2 - 2
control_plane/roles/webui_awx/vars/main.yml

@@ -71,7 +71,7 @@ credential_details:
   - { name: ethernet_credential, type: Machine, username: "{{ ethernet_switch_username }}", password: "{{ ethernet_switch_password }}", flag: "{{ ethernet_switch_support }}" }
   - { name: infiniband_credential, type: Network, username: "{{ ib_username }}", password: "{{ ib_password }}", flag: "{{ ib_switch_support }}" }
   - { name: powervault_me4_credential, type: Network, username: "{{ powervault_me4_username }}", password: "{{ powervault_me4_password }}", flag: "{{ powervault_support }}" }
-  - { name: node_credential, type: Machine, username: root, password: omnia@123, flag: true }
+  - { name: node_credential, type: Machine, username: root, password: "{{ provision_password }}", flag: true }
 job_template_details:
   - { name: idrac_template, inventory: idrac_inventory, playbook: control_plane/idrac.yml, credential: idrac_credential, flag: true }
   - { name: ethernet_template, inventory: ethernet_inventory, playbook: control_plane/ethernet.yml, credential: ethernet_credential, flag: "{{ ethernet_switch_support }}" }
@@ -83,4 +83,4 @@ omnia_job_template_details:
   - { name: deploy_omnia_template, inventory: node_inventory, playbook: omnia.yml, credential: node_credential }  
 scheduled_templates:
   - { name: NodeInventorySchedule, template: node_inventory_job, schedule_rule: "DTSTART:20210815T120000Z RRULE:FREQ=MINUTELY;INTERVAL=10" }
-  - { name: DeviceInventorySchedule, template: device_inventory_job, schedule_rule: "DTSTART:20210815T060000Z RRULE:FREQ=DAILY;INTERVAL=1"}
+  - { name: DeviceInventorySchedule, template: device_inventory_job, schedule_rule: "DTSTART:20210815T060000Z RRULE:FREQ=DAILY;INTERVAL=1"}