Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert bootc support from main (using bootc feature branch instead) #844

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed roles/edpm_bootc/files/.gitkeep
Empty file.
7 changes: 0 additions & 7 deletions roles/edpm_bootc/meta/argument_specs.yml

This file was deleted.

43 changes: 0 additions & 43 deletions roles/edpm_bootc/meta/main.yml

This file was deleted.

3 changes: 0 additions & 3 deletions roles/edpm_bootc/molecule/default/collections.yml

This file was deleted.

21 changes: 0 additions & 21 deletions roles/edpm_bootc/molecule/default/converge.yml

This file was deleted.

30 changes: 0 additions & 30 deletions roles/edpm_bootc/molecule/default/molecule.yml

This file was deleted.

22 changes: 0 additions & 22 deletions roles/edpm_bootc/molecule/default/prepare.yml

This file was deleted.

24 changes: 0 additions & 24 deletions roles/edpm_bootc/tasks/main.yml

This file was deleted.

59 changes: 0 additions & 59 deletions roles/edpm_bootstrap/tasks/bootstrap-common-post-packages.yml

This file was deleted.

61 changes: 0 additions & 61 deletions roles/edpm_bootstrap/tasks/bootstrap-common-pre-packages.yml

This file was deleted.

106 changes: 92 additions & 14 deletions roles/edpm_bootstrap/tasks/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,102 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Import edpm_bootc role
ansible.builtin.import_role:
name: edpm_bootc
- name: Ensure /var/log/journal exists
ansible.builtin.file:
path: /var/log/journal
state: directory
mode: '0750'
owner: root
group: root
setype: var_log_t
become: true

- name: Import common pre packages tasks
ansible.builtin.import_tasks: bootstrap-common-pre-packages.yml
- name: Gather services facts
ansible.builtin.service_facts:

- name: Include packages tasks
ansible.builtin.include_tasks: packages.yml
when: not bootc
- name: Print cloud-init service status
ansible.builtin.debug:
var: ansible_facts.services["cloud-init.service"]

- name: Import common post packages tasks
ansible.builtin.import_tasks: bootstrap-common-post-packages.yml
- name: Check if cloud-init is disabled via kernel args
ansible.builtin.lineinfile:
path: /proc/cmdline
line: "cloud-init=disabled"
state: present
check_mode: true
register: cloud_init_vendor_disabled

- name: Include swap tasks
ansible.builtin.include_tasks: swap.yml
when: not bootc
- name: Wait for cloud-init to finish, if enabled
community.general.cloud_init_data_facts:
filter: status
register: res
until: >
res.cloud_init_data_facts.status.v1.stage is defined and
not res.cloud_init_data_facts.status.v1.stage
retries: 50
delay: 5
when:
- not ansible_check_mode
- ansible_facts.services["cloud-init.service"] is defined
- ansible_facts.services["cloud-init.service"]["status"] != "not-found"
- ansible_facts.services["cloud-init.service"]["state"] == "running"
- ansible_facts.services["cloud-init.service"]["status"] == "enabled"
- cloud_init_vendor_disabled is changed
become: true

- name: Import FIPS tasks
- name: Execute bootstrap command
ansible.builtin.import_tasks: bootstrap_command.yml

- name: Import packages tasks
ansible.builtin.import_tasks: packages.yml

- name: Set selinux state
ansible.posix.selinux:
policy: targeted
state: "{{ edpm_bootstrap_selinux_mode }}"
become: true

- name: Stop NetworkManager from updating resolv.conf
when: ( edpm_bootstrap_network_service == 'NetworkManager' ) and ( not edpm_bootstrap_network_resolvconf_update )
become: true
block:
- name: Set 'dns=none' in /etc/NetworkManager/NetworkManager.conf
community.general.ini_file:
path: /etc/NetworkManager/NetworkManager.conf
state: present
no_extra_spaces: true
section: main
option: dns
value: none
backup: true
mode: '0644'
- name: Set 'rc-manager=unmanaged' in /etc/NetworkManager/NetworkManager.conf
community.general.ini_file:
path: /etc/NetworkManager/NetworkManager.conf
state: present
no_extra_spaces: true
section: main
option: rc-manager
value: unmanaged
backup: true
mode: '0644'
- name: Reload NetworkManager
ansible.builtin.systemd:
name: NetworkManager
state: reloaded

- name: Stop dhclient from updating resolv.conf
become: true
ansible.builtin.copy:
dest: /etc/dhcp/dhclient-enter-hooks
mode: "0755"
content: |
#!/bin/sh
make_resolv_conf() { : ; }

- name: Configure swap
ansible.builtin.import_tasks: swap.yml

- name: FIPS tasks
ansible.builtin.import_tasks: fips.yml
when: edpm_bootstrap_fips_mode != 'check'
Loading
Loading