Skip to content

Commit

Permalink
Bump ubuntu to 24.04 in foreman_provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka committed Oct 17, 2024
1 parent de3e3b2 commit 2e8254a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
- name: 'create Ubuntu 17.10'
- name: 'create Ubuntu 24.04'
shell: >
{{ foreman_provisioning_hammer }} os info --title "Ubuntu 17.10" ||
{{ foreman_provisioning_hammer }} os info --title "Ubuntu 24.04" ||
{{ foreman_provisioning_hammer }} os create
--name Ubuntu --major 17 --minor 10 --release-name 'artful' --architectures x86_64 --family 'Debian' --media 'Ubuntu mirror' --partition-tables 'Preseed default'
--name Ubuntu --major 24 --minor 04 --release-name 'artful' --architectures x86_64 --family 'Debian' --media 'Ubuntu mirror' --partition-tables 'Preseed default'
- name: 'find Ubuntu 17.10'
- name: 'find Ubuntu 24.04'
shell: >
{{ foreman_provisioning_hammer }} --output json os info --name "Ubuntu 17.10" ||
{{ foreman_provisioning_hammer }} --output json os info --title "Ubuntu 17.10"
register: foreman_provisioning_ubuntu1710_json
{{ foreman_provisioning_hammer }} --output json os info --name "Ubuntu 24.04" ||
{{ foreman_provisioning_hammer }} --output json os info --title "Ubuntu 24.04"
register: foreman_provisioning_ubuntu2404_json
ignore_errors: True

- name: 'get Ubuntu 17.10 info'
- name: 'get Ubuntu 24.04 info'
set_fact:
foreman_provisioning_ubuntu1710: "{{ foreman_provisioning_ubuntu1710_json.stdout|from_json }}"
foreman_provisioning_ubuntu2404: "{{ foreman_provisioning_ubuntu2404_json.stdout|from_json }}"

- name: 'find preseed templates'
shell: >
Expand All @@ -25,12 +25,12 @@
set_fact:
preseed_templates: "{{ preseed_templates_json.stdout|from_json }}"

- name: 'associate preseed templates to Ubuntu 17.10'
- name: 'associate preseed templates to Ubuntu 24.04'
shell: >
{{ foreman_provisioning_hammer }} template add-operatingsystem --id {{ item.Id }} --operatingsystem 'Ubuntu 17.10'
{{ foreman_provisioning_hammer }} template add-operatingsystem --id {{ item.Id }} --operatingsystem 'Ubuntu 24.04'
with_items: "{{ preseed_templates }}"

- name: 'set default templates for Ubuntu 17.10'
- name: 'set default templates for Ubuntu 24.04'
shell: >
{{ foreman_provisioning_hammer }} os set-default-template --id {{ foreman_provisioning_ubuntu1710.Id }} --provisioning-template-id {{ item.Id }}
{{ foreman_provisioning_hammer }} os set-default-template --id {{ foreman_provisioning_ubuntu2404.Id }} --provisioning-template-id {{ item.Id }}
with_items: "{{ preseed_templates }}"
4 changes: 2 additions & 2 deletions roles/foreman_provisioning/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
- name: 'Setup Debian 12.7 provisioning'
import_tasks: configure_debian_12_7.yml

- name: 'Setup Ubuntu 17.10 provisioning'
import_tasks: configure_ubuntu_17_10.yml
- name: 'Setup Ubuntu 24.04 provisioning'
import_tasks: configure_ubuntu_24_04.yml

# TODO verify - should not be needed, DNS should work just fine
- name: 'set unattended_url'
Expand Down

0 comments on commit 2e8254a

Please sign in to comment.