-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adding support for custom %post sections - Adding support for adding users - Adding support to enable FIPS in the custom ISO
- Loading branch information
Showing
13 changed files
with
687 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
- name: 'Set fact: Start building the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: "{{ 'user --name=' ~ _user.name }}" | ||
|
||
- name: 'Set fact: Insert gecos into the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: "{{ _user_statement ~ ' --gecos=\"' ~ _user.gecos ~ '\"' }}" | ||
when: > | ||
_user.gecos is defined | ||
and _user.gecos != '' | ||
and _user.gecos != None | ||
- name: 'Set fact: Insert uid into the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: "{{ _user_statement ~ ' --uid=' ~ _user.uid }}" | ||
when: > | ||
_user.uid is defined | ||
and _user.uid | string != '' | ||
- name: 'Set fact: Insert gid into the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: "{{ _user_statement ~ ' --gid=' ~ _user.gid }}" | ||
when: > | ||
_user.gid is defined | ||
and _user.gid | string != '' | ||
- name: 'Set fact: Insert groups into the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: "{{ _user_statement ~ ' --groups=' ~ _user.groups | join(',') }}" | ||
when: > | ||
_user.groups is defined | ||
and _user.groups | string != '' | ||
- name: 'Set fact: Insert homedir into the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: "{{ _user_statement ~ ' --homedir=' ~ _user.home }}" | ||
when: > | ||
_user.home is defined | ||
and _user.home | string != '' | ||
- name: 'Set fact: Insert shell into the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: "{{ _user_statement ~ ' --shell=' ~ _user.shell }}" | ||
when: > | ||
_user.shell is defined | ||
and _user.shell | string != '' | ||
- name: 'Set fact: Insert lock into the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: "{{ _user_statement ~ ' --lock' }}" | ||
when: > | ||
_user.lock is defined | ||
and _user.lock | ||
- name: 'Set fact: Insert password into the user statement for user {{ _user.name }}' | ||
ansible.builtin.set_fact: | ||
_user_statement: > | ||
{{ | ||
_user_statement ~ ' --iscrypted --password=' ~ | ||
_user.password | string | ansible.builtin.password_hash(hashtype='sha512') | ||
}} | ||
no_log: true | ||
when: > | ||
_user.gid is defined | ||
and _user.gid | string != '' | ||
- name: 'Insert user creation statement into the provided kickstart for user {{ _user.name }}' | ||
ansible.builtin.lineinfile: | ||
path: '{{ __work_dir_kickstart_path }}' | ||
regex: '^user\s--name={{ _user.name }}.+$' | ||
line: '{{ _user_statement }}' | ||
no_log: true | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,4 @@ | |
mode: '{{ _iso_mode }}' | ||
checksum: 'sha256:{{ _checksum }}' | ||
timeout: '{{ _download_timeout }}' | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
- name: 'Update kernel parameters to enable FIPS compliant cryptography (MD5 implanting requested)' | ||
ansible.builtin.lineinfile: | ||
path: '{{ _cfg_path }}' | ||
regexp: '^(.+)(hd:LABEL[A-z0-9_=-]+)(\sinst\.ks=\2:/ks\.cfg)?(\srd.live.check\squiet)(\sfips=1)?$' | ||
line: '\1\2 inst.ks=\2:/ks.cfg\4 fips=1' | ||
backrefs: true | ||
become: true | ||
loop: | ||
- '{{ __src_files_path }}/{{ _pxelinux_cfg_path }}' # BIOS | ||
- '{{ __src_files_path }}/{{ _grub_cfg_path_uefi }}' # UEFI | ||
loop_control: | ||
loop_var: '_cfg_path' | ||
when: > | ||
_implant_md5 is defined | ||
and _implant_md5 | ||
- name: 'BIOS/UEFI: Update kernel parameters to enable FIPS compliant cryptography' | ||
ansible.builtin.lineinfile: | ||
path: '{{ _cfg_path }}' | ||
regexp: '^(.+)(hd:LABEL[A-z0-9_=-]+)(\sinst\.ks=\2:/ks\.cfg)?(\squiet)(\sfips=1)?$' | ||
line: '\1\2 inst.ks=\2:/ks.cfg\4 fips=1' | ||
backrefs: true | ||
become: true | ||
loop: | ||
- '{{ __src_files_path }}/{{ _pxelinux_cfg_path }}' # BIOS | ||
- '{{ __src_files_path }}/{{ _grub_cfg_path_uefi }}' # UEFI | ||
loop_control: | ||
loop_var: '_cfg_path' |
Oops, something went wrong.