From cfe024a210ddb6e41ddeea654ac37ddce7da7310 Mon Sep 17 00:00:00 2001 From: stephane Date: Wed, 29 Jul 2015 11:48:40 -0700 Subject: [PATCH] Clarify variable names & cleanup docs The deploy_kernel* and deploy_ramdisk* variables were confusingly named because they looked similar to deploy_image. I've renamed them to ipa_kernel* and ipa_ramdisk* to reflect that they are the CoreOS kernel and ramdisk from IPA and have updated the documentation. I also cleaned up a minor issue where we defined a path for the local copies of the kernel and ramdisk but didn't use it in the install playbook. I've also removed deploy_image_upstream_url from the offline installation documentation as we no longer use it. Partial-Bug: 1478726 Change-Id: Ia8c865521974e6bdd9e8e6a3ffa4c5f6b1f2f6ad --- doc/source/offline-install.rst | 5 ++--- playbooks/cleanup-deployment-images.yaml | 4 ++-- playbooks/inventory/group_vars/all | 8 ++++---- playbooks/roles/ironic-enroll-dynamic/README.md | 10 ++++++---- playbooks/roles/ironic-enroll-dynamic/tasks/main.yml | 4 ++-- playbooks/roles/ironic-install/defaults/main.yml | 12 ++++++------ .../ironic-install/tasks/download_ipa_coreos.yml | 8 ++++---- 7 files changed, 26 insertions(+), 25 deletions(-) diff --git a/doc/source/offline-install.rst b/doc/source/offline-install.rst index e05463189..8488a7777 100644 --- a/doc/source/offline-install.rst +++ b/doc/source/offline-install.rst @@ -43,9 +43,8 @@ As an example, my current file looks like: .. code-block:: yaml - deploy_kernel_upstream_url: file:///vagrant/coreos_production_pxe.vmlinuz - deploy_ramdisk_upstream_url: file:///vagrant/coreos_production_pxe_image-oem.cpio.gz - deploy_image_upstream_url: file:///vagrant/ubuntu-14.04-server-cloudimg-amd64.tar.gz + ipa_kernel_upstream_url: file:///vagrant/coreos_production_pxe.vmlinuz + ipa_ramdisk_upstream_url: file:///vagrant/coreos_production_pxe_image-oem.cpio.gz cirros_deploy_image_upstream_url: file:///vagrant/cirros-0.3.4-x86_64-disk.img dib_git_url: file:///vagrant/git/diskimage-builder ironicclient_git_url: file:///vagrant/git/python-ironicclient diff --git a/playbooks/cleanup-deployment-images.yaml b/playbooks/cleanup-deployment-images.yaml index e3ce2fac1..745c4c977 100644 --- a/playbooks/cleanup-deployment-images.yaml +++ b/playbooks/cleanup-deployment-images.yaml @@ -6,5 +6,5 @@ gather_facts: yes tasks: - file: path=/tftpboot/master_images state=absent - - file: path="{{deploy_kernel}}" state=absent - - file: path="{{deploy_ramdisk}}" state=absent + - file: path="{{ipa_kernel}}" state=absent + - file: path="{{ipa_ramdisk}}" state=absent diff --git a/playbooks/inventory/group_vars/all b/playbooks/inventory/group_vars/all index f6974d37b..a7f428e31 100644 --- a/playbooks/inventory/group_vars/all +++ b/playbooks/inventory/group_vars/all @@ -16,10 +16,10 @@ testing_user: ubuntu http_boot_folder: /httpboot nginx_port: 8080 ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" -deploy_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" -deploy_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" -deploy_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz" -deploy_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz" +ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" +ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" +ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz" +ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz" # When using disk image builder based image generation, which is the # default at this time, the deploy_image_filename must end with .qcow2 # due to the image creation process. diff --git a/playbooks/roles/ironic-enroll-dynamic/README.md b/playbooks/roles/ironic-enroll-dynamic/README.md index 9417eea1b..ee97c2503 100644 --- a/playbooks/roles/ironic-enroll-dynamic/README.md +++ b/playbooks/roles/ironic-enroll-dynamic/README.md @@ -18,11 +18,13 @@ Role Variables ironic_url: The setting defining the URL to the Ironic API. Presently defaulted to: "http://localhost:6385/" -deploy_kernel: The kernel url, image id, or file representing the kernel to - utilize for deploying to this node. +ipa_kernel: The kernel url, image id, or file representing the kernel to + utilize for deploying to this node. This should be the + CoreOS kernel used by Ironic Python Agent. -deploy_ramdisk: The ramdisk url, image id, or file representing the ramdisk - image to load to deploy this node. +ipa_ramdisk: The ramdisk url, image id, or file representing the ramdisk + image to load to deploy this node. This should be the + CoreOS ramdisk used by Ironic Python Agent. This role expects a data structure similar to the one below, however it should be understood that the individual entries under power can vary based on power diff --git a/playbooks/roles/ironic-enroll-dynamic/tasks/main.yml b/playbooks/roles/ironic-enroll-dynamic/tasks/main.yml index 15b8bd255..31be59cda 100644 --- a/playbooks/roles/ironic-enroll-dynamic/tasks/main.yml +++ b/playbooks/roles/ironic-enroll-dynamic/tasks/main.yml @@ -25,6 +25,6 @@ driver_info: power: "{{ driver_info.power }}" deploy: - deploy_kernel: "{{ deploy_kernel_url }}" - deploy_ramdisk: "{{ deploy_ramdisk_url }}" + deploy_kernel: "{{ ipa_kernel_url }}" + deploy_ramdisk: "{{ ipa_ramdisk_url }}" delegate_to: localhost diff --git a/playbooks/roles/ironic-install/defaults/main.yml b/playbooks/roles/ironic-install/defaults/main.yml index 7802e065a..4b181d6c5 100644 --- a/playbooks/roles/ironic-install/defaults/main.yml +++ b/playbooks/roles/ironic-install/defaults/main.yml @@ -14,12 +14,12 @@ transform_boot_image: false # virtual machines for the hardware instead of real hardware. testing: false ci_testing: false -deploy_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" -deploy_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" -deploy_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz" -deploy_kernel_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe.vmlinuz -deploy_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz" -deploy_ramdisk_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem.cpio.gz +ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" +ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" +ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz" +ipa_kernel_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe.vmlinuz +ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz" +ipa_ramdisk_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem.cpio.gz deploy_image_filename: "deployment_image.qcow2" deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" # Use cirros instead of building an image via diskimage-builder diff --git a/playbooks/roles/ironic-install/tasks/download_ipa_coreos.yml b/playbooks/roles/ironic-install/tasks/download_ipa_coreos.yml index 1159f5a39..1cde102e6 100644 --- a/playbooks/roles/ironic-install/tasks/download_ipa_coreos.yml +++ b/playbooks/roles/ironic-install/tasks/download_ipa_coreos.yml @@ -16,14 +16,14 @@ # This is overly complex, however get_url will always re-retrieve the file # if it already exists, and this is to prevent that behavior. - name: "Test if CoreOS kernel is present" - stat: path={{ http_boot_folder }}/coreos_production_pxe.vmlinuz + stat: path={{ ipa_kernel }} register: test_core_os_kernel_present - name: "Download CoreOS kernel" - get_url: url={{ deploy_kernel_upstream_url }} dest={{ http_boot_folder }}/coreos_production_pxe.vmlinuz + get_url: url={{ ipa_kernel_upstream_url }} dest={{ ipa_kernel }} when: test_core_os_kernel_present.stat.exists == false - name: "Test if CoreOS image is present" - stat: path={{ http_boot_folder }}/coreos_production_pxe_image-oem.cpio.gz + stat: path={{ ipa_ramdisk }} register: test_core_os_image_present - name: "Download CoreOS image" - get_url: url={{ deploy_ramdisk_upstream_url }} dest={{ http_boot_folder }}/coreos_production_pxe_image-oem.cpio.gz + get_url: url={{ ipa_ramdisk_upstream_url }} dest={{ ipa_ramdisk }} when: test_core_os_image_present.stat.exists == false