|
@@ -38,19 +38,55 @@
|
|
no_log: true
|
|
no_log: true
|
|
tags: install
|
|
tags: install
|
|
|
|
|
|
-- name: Create the kickstart file
|
|
|
|
- copy:
|
|
|
|
- src: "{{ role_path }}/files/temp_centos7.ks"
|
|
|
|
- dest: "{{ role_path }}/files/centos7.ks"
|
|
|
|
- mode: 0775
|
|
|
|
- tags: install
|
|
|
|
|
|
+- name: Kickstart configuration - centos
|
|
|
|
+ block:
|
|
|
|
+ - name: Create the kickstart file
|
|
|
|
+ copy:
|
|
|
|
+ src: "{{ role_path }}/files/temp_centos7.ks"
|
|
|
|
+ dest: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
|
|
+ mode: 0775
|
|
|
|
+ tags: install
|
|
|
|
|
|
-- name: Configure kickstart file- IP
|
|
|
|
- replace:
|
|
|
|
- path: "{{ role_path }}/files/centos7.ks"
|
|
|
|
- regexp: '^url --url http://ip/cblr/links/CentOS7-x86_64/'
|
|
|
|
- replace: url --url http://{{ hpc_ip }}/cblr/links/CentOS7-x86_64/
|
|
|
|
- tags: install
|
|
|
|
|
|
+ - name: Configure kickstart file - IP
|
|
|
|
+ replace:
|
|
|
|
+ path: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
|
|
+ regexp: '^url --url http://ip/cblr/links/centos-x86_64/'
|
|
|
|
+ replace: url --url http://{{ hpc_ip }}/cblr/links/CentOS7-x86_64/
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Configure kickstart file - nic
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
|
|
+ insertafter: '^network --bootproto=dhcp --device=link --onboot=on --activate'
|
|
|
|
+ line: 'network --bootproto=dhcp --device={{ item }} --onboot=on --activate'
|
|
|
|
+ tags: install
|
|
|
|
+ with_items: "{{ centos_host_nic }}"
|
|
|
|
+ when: provision_os == os_supported_centos
|
|
|
|
+
|
|
|
|
+- name: Kickstart configuration - rocky
|
|
|
|
+ block:
|
|
|
|
+ - name: Create the kickstart file
|
|
|
|
+ copy:
|
|
|
|
+ src: "{{ role_path }}/files/temp_rocky8.ks"
|
|
|
|
+ dest: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
|
|
+ mode: 0775
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Configure kickstart file - IP
|
|
|
|
+ replace:
|
|
|
|
+ path: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
|
|
+ regexp: '^url --url http://ip/cblr/links/rocky-x86_64/'
|
|
|
|
+ replace: url --url http://{{ hpc_ip }}/cblr/links/Rocky8-x86_64/
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Configure kickstart file - nic
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
|
|
+ insertafter: '^network --bootproto=dhcp --device=link --onboot=on --activate'
|
|
|
|
+ line: 'network --bootproto=dhcp --device={{ item }} --onboot=on --activate'
|
|
|
|
+ tags: install
|
|
|
|
+ with_items: "{{ rocky_host_nic }}"
|
|
|
|
+ when: provision_os == os_supported_rocky
|
|
|
|
|
|
- name: Random phrase generation
|
|
- name: Random phrase generation
|
|
command: openssl rand -base64 12
|
|
command: openssl rand -base64 12
|
|
@@ -80,25 +116,29 @@
|
|
no_log: true
|
|
no_log: true
|
|
tags: install
|
|
tags: install
|
|
|
|
|
|
-- name: Configure kickstart file- Password
|
|
|
|
|
|
+- name: Configure kickstart file - Password
|
|
replace:
|
|
replace:
|
|
- path: "{{ role_path }}/files/centos7.ks"
|
|
|
|
- regexp: '^rootpw --iscrypted password'
|
|
|
|
|
|
+ path: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
|
|
+ regexp: '^rootpw --iscrypted ks_password'
|
|
replace: 'rootpw --iscrypted {{ login_pass.stdout }}'
|
|
replace: 'rootpw --iscrypted {{ login_pass.stdout }}'
|
|
no_log: true
|
|
no_log: true
|
|
tags: install
|
|
tags: install
|
|
|
|
|
|
-- name: Configure kickstart file- nic
|
|
|
|
- lineinfile:
|
|
|
|
- path: "{{ role_path }}/files/centos7.ks"
|
|
|
|
- insertafter: '^network --bootproto=dhcp --device=link --onboot=on --activate'
|
|
|
|
- line: 'network --bootproto=dhcp --device={{ item }} --onboot=on --activate'
|
|
|
|
- tags: install
|
|
|
|
- with_items: "{{ host_nic }}"
|
|
|
|
-
|
|
|
|
-- name: Configure kickstart file- timezone
|
|
|
|
|
|
+- name: Configure kickstart file - timezone
|
|
replace:
|
|
replace:
|
|
- path: "{{ role_path }}/files/centos7.ks"
|
|
|
|
|
|
+ path: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
regexp: '^timezone --utc ks_timezone'
|
|
regexp: '^timezone --utc ks_timezone'
|
|
replace: 'timezone --utc {{ timezone }}'
|
|
replace: 'timezone --utc {{ timezone }}'
|
|
tags: install
|
|
tags: install
|
|
|
|
+
|
|
|
|
+- name: Configure kickstart file - language
|
|
|
|
+ replace:
|
|
|
|
+ path: "{{ role_path }}/files/{{ cobbler_kickstart_file }}"
|
|
|
|
+ regexp: '^lang ks_language'
|
|
|
|
+ replace: 'lang {{ language }}'
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+- name: Remove ^M characters
|
|
|
|
+ command: dos2unix {{ role_path }}/files/{{ cobbler_kickstart_file }}
|
|
|
|
+ changed_when: false
|
|
|
|
+ failed_when: false
|