aboutsummaryrefslogtreecommitdiffstats
path: root/util/docker-compose/roles/cobbler
diff options
context:
space:
mode:
authorYibo Cai <yibo.cai@arm.com>2017-12-22 18:04:42 +0800
committerYibo Cai <yibo.cai@arm.com>2018-01-14 11:27:41 +0000
commitec8cc0f7665b1fd1f34ae31a50c4fb1b67c342ea (patch)
tree9a6790c38ab667278ea7281f5fd125460647753e /util/docker-compose/roles/cobbler
parenta322fe981bb0fc11f2c83e3c887921ebf3af1dc3 (diff)
docker-compose: support aarch64
Change-Id: I4b1bce45f8412af7076dca90bbb4c1193057d110 Signed-off-by: Yibo Cai <yibo.cai@arm.com>
Diffstat (limited to 'util/docker-compose/roles/cobbler')
-rwxr-xr-xutil/docker-compose/roles/cobbler/tasks/main.yml51
-rwxr-xr-xutil/docker-compose/roles/cobbler/templates/dhcp.template.j22
2 files changed, 42 insertions, 11 deletions
diff --git a/util/docker-compose/roles/cobbler/tasks/main.yml b/util/docker-compose/roles/cobbler/tasks/main.yml
index e3f13088..0a30e0c5 100755
--- a/util/docker-compose/roles/cobbler/tasks/main.yml
+++ b/util/docker-compose/roles/cobbler/tasks/main.yml
@@ -44,23 +44,22 @@
docker cp "{{ compass_dists_dir }}/{{ item.value.ppa_name }}.tar.gz" compass-cobbler:/tmp
docker exec compass-cobbler bash -c \
"mkdir -p /var/lib/cobbler/repo_mirror/{{ item.value.ppa_name }}"
- with_dict: "{{ distros }}"
+ with_dict: "{{ vars['distros_' + ansible_architecture] }}"
run_once: "True"
ignore_errors: "True"
- name: cobbler import iso
shell: |
- name=`basename {{ item.value.iso_name }} | \
- sed -e 's/.iso//g' -e 's/-amd64//g' -e 's/-x86_64//g'`
+ name="{{ item.value.cobbler_name }}"
docker exec compass-cobbler bash -c \
"service cobblerd restart;
sleep 3;
cobbler import --name $name \
--path /mnt/{{ item.value.iso_name }} \
- --arch x86_64 \
+ --arch {{ item.value.cobbler_arch }} \
--kickstart /var/lib/cobbler/kickstarts/{{ item.value.kickstart }} \
--breed {{ item.value.breed }}"
- with_dict: "{{ distros }}"
+ with_dict: "{{ vars['distros_' + ansible_architecture] }}"
run_once: "True"
register: result2
until: result2.rc == 0
@@ -73,14 +72,14 @@
"cobbler repo add --name {{ item.value.ppa_name }} \
--mirror /var/lib/cobbler/repo_mirror/{{ item.value.ppa_name }} \
--mirror-locally True \
- --arch=x86_64 {{ item.value.extra | default()}}"
- with_dict: "{{ distros }}"
+ --arch={{ item.value.cobbler_arch }} \
+ {{ item.value.extra | default() }}"
+ with_dict: "{{ vars['distros_' + ansible_architecture] }}"
run_once: "True"
-- name: edit profiles
+- name: edit profiles for x86_64
shell: |
- name=`basename {{ item.value.iso_name }} | \
- sed -e 's/.iso//g' -e 's/-amd64//g' -e 's/-x86_64//g'`-x86_64
+ name="{{ item.value.cobbler_name }}-x86_64"
docker exec compass-cobbler bash -c \
"cobbler profile edit --name $name \
--name-servers '' \
@@ -88,8 +87,38 @@
--ksmeta \"tree=http://{{ host_ip }}/cobbler/ks_mirror/$name\" \
--kopts \"{{ item.value.kopts | default('') }}\" \
--kopts-post \"{{ item.value.kopts_post | default('') }}\""
- with_dict: "{{ distros }}"
+ with_dict: "{{ distros_x86_64 }}"
run_once: "True"
+ when: ansible_architecture == "x86_64"
+
+- name: edit profile for aarch64
+ shell: |
+ # Cobbler naming on Arm is a mess
+ # Imported name:
+ # - CentOS-7-Minimal-1611
+ # - ubuntu-16.04-server
+ # Profile name:
+ # - CentOS-7-Minimal-1611-arm-arm
+ # - ubuntu-16.04-server-arm-arm64-arm
+ # Kickstart meta url name
+ # - http://x.x.x.x/cobbler/ks_mirror/CentOS-7-Minimal-1611-arm
+ # - http://x.x.x.x/cobbler/ks_mirror/ubuntu-16.04-server-arm-arm64
+ name="{{ item.value.cobbler_name }}-arm"
+ profiles=`docker exec compass-cobbler bash -c \
+ "cobbler profile list | grep $name"`
+ for profile_name in $profiles; do
+ docker exec compass-cobbler bash -c \
+ "cobbler profile edit \
+ --name $profile_name \
+ --name-servers '' \
+ --repos {{ item.value.ppa_name }} \
+ --ksmeta \"tree=http://{{ host_ip }}/cobbler/ks_mirror/${profile_name%????}\" \
+ --kopts \"{{ item.value.kopts | default('') }}\" \
+ --kopts-post \"{{ item.value.kopts_post | default('') }}\""
+ done
+ with_dict: "{{ distros_aarch64 }}"
+ run_once: "True"
+ when: ansible_architecture == "aarch64"
- name: cobbler sync
shell: |
diff --git a/util/docker-compose/roles/cobbler/templates/dhcp.template.j2 b/util/docker-compose/roles/cobbler/templates/dhcp.template.j2
index 0665f2fe..8b1f2a61 100755
--- a/util/docker-compose/roles/cobbler/templates/dhcp.template.j2
+++ b/util/docker-compose/roles/cobbler/templates/dhcp.template.j2
@@ -42,6 +42,8 @@ subnet {{ install_subnet }} netmask {{ install_netmask }} {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
+ } else if option pxe-system-type = 00:0B {
+ filename "grub/grub-aarch64.efi";
} else {
filename "pxelinux.0";
}