Clean up text in playbooks, roles, and associated files

Many minor cleanups, including:
- Consistent capitalization for ironic and bifrost
- Typos
- Prefer more active construction in task names
- Reflow comment text where appropriate for enhanced
  readability

Change-Id: I05a1ecd6c49003e02961ab3c9cbbcb3b31cd4af6
This commit is contained in:
stephane 2015-09-11 13:46:15 -07:00
parent 5cff30dc26
commit 85a8f3cfe9
26 changed files with 151 additions and 150 deletions

View File

@ -1,7 +1,7 @@
--- ---
- hosts: localhost - hosts: localhost
connection: local connection: local
name: "Removes the master_images folder and deployment kernel/ramdisk for clean redeployments when testing." name: "Remove the master_images folder and deployment kernel/ramdisk for clean redeployments when testing."
sudo: yes sudo: yes
gather_facts: yes gather_facts: yes
tasks: tasks:

View File

@ -28,7 +28,7 @@ The inventory currently supplies two distinct groups:
- baremetal - baremetal
The localhost group is required for Bifrost to perform local actions to The localhost group is required for Bifrost to perform local actions to
Bifrost for local actions such as installing Ironic. bifrost for local actions such as installing Ironic.
The baremetal group contains the hosts defined by the data source along with The baremetal group contains the hosts defined by the data source along with
variables extracted from the data source. The variables are defined on a variables extracted from the data source. The variables are defined on a
@ -36,7 +36,7 @@ per-host level which allows explict actions to be taken based upon the
variables. variables.
Presently, the base mode of operation reads a CSV file in the format Presently, the base mode of operation reads a CSV file in the format
originally utilized by Bifrost and returns structured JSON that is originally utilized by bifrost and returns structured JSON that is
interpretted by Ansible. This has since been extended to support the interpretted by Ansible. This has since been extended to support the
parsing of JSON and YAML data if they are detected in the file. parsing of JSON and YAML data if they are detected in the file.

View File

@ -1,10 +1,10 @@
--- ---
# The Ironic API URL for Bifrost Operations. Defaults to localhost. # The ironic API URL for bifrost operations. Defaults to localhost.
#ironic_url: "http://localhost:6385/" # ironic_url: "http://localhost:6385/"
# The network interface that Bifrost will be operating on. Defaults # The network interface that bifrost will be operating on. Defaults
# to virbr0 in roles, can be overridden here. # to virbr0 in roles, can be overridden here.
#network_interface: "virbr0" # network_interface: "virbr0"
# The path to the SSH key to be utilized for testing and burn-in # The path to the SSH key to be utilized for testing and burn-in
# to configuration drives. When set, it should be set in both baremetal # to configuration drives. When set, it should be set in both baremetal
@ -21,24 +21,24 @@ testing_user: root
# the localhost and baremetal group files must be updated. # the localhost and baremetal group files must be updated.
# nginx_port: 8080 # nginx_port: 8080
#IPA Image parameters. If these are changed, they must be changed in # IPA Image parameters. If these are changed, they must be changed in
# Both localhost and baremetal groups. Presently the defaults # Both localhost and baremetal groups. Presently the defaults
# in each role should be sufficent for proper operation. # in each role should be sufficent for proper operation.
#ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" # ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
#ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" # 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_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" # ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
# The http_boot_folder defines the root folder for the webserver. # The http_boot_folder defines the root folder for the webserver.
# If this setting is changed, it must be applied to both the baremetal # If this setting is changed, it must be applied to both the baremetal
# and localhost groups. Presently the role defaults are set to the value # and localhost groups. Presently the role defaults are set to the value
# below. # below.
#http_boot_folder: /httpboot # http_boot_folder: /httpboot
# The settings for the name of the image to be deployed along with the # The settings for the name of the image to be deployed along with the
# on disk location are below. If changed, these settings must be applied # on disk location are below. If changed, these settings must be applied
# to both the baremetal and localhost groups. If the file is already on # to both the baremetal and localhost groups. If the file is already on
# disk, then the image generation will not take place, otherwise an image # disk, then the image generation will not take place, otherwise an image
# will be generated using diskimage-builder. # will be generated using diskimage-builder.
#deploy_image_filename: "deployment_image.qcow2" # deploy_image_filename: "deployment_image.qcow2"
#deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" # deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"

View File

@ -1,10 +1,10 @@
--- ---
# The Ironic API URL for Bifrost Operations. Defaults to localhost. # The ironic API URL for bifrost operations. Defaults to localhost.
#ironic_url: "http://localhost:6385/" # ironic_url: "http://localhost:6385/"
# The network interface that Bifrost will be operating on. Defaults # The network interface that bifrost will be operating on. Defaults
# to virbr0 in roles, can be overridden here. # to virbr0 in roles, can be overridden here.
#network_interface: "virbr0" # network_interface: "virbr0"
# ironic_db_password ironic user password for rabbit # ironic_db_password ironic user password for rabbit
@ -26,39 +26,40 @@ mysql_password:
# the localhost and baremetal group files must be updated. # the localhost and baremetal group files must be updated.
# nginx_port: 8080 # nginx_port: 8080
#IPA Image parameters. If these are changed, they must be changed in # IPA Image parameters. If these are changed, they must be changed in
# Both localhost and baremetal groups. Presently the defaults # Both localhost and baremetal groups. Presently the defaults
# in each role should be sufficent for proper operation. # in each role should be sufficent for proper operation.
#ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" # ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
#ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" # 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_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" # ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
# The http_boot_folder defines the root folder for the webserver. # The http_boot_folder defines the root folder for the webserver.
# If this setting is changed, it must be applied to both the baremetal # If this setting is changed, it must be applied to both the baremetal
# and localhost groups. Presently the role defaults are set to the value # and localhost groups. Presently the role defaults are set to the value
# below. # below.
#http_boot_folder: /httpboot # http_boot_folder: /httpboot
# The settings for the name of the image to be deployed along with the # The settings for the name of the image to be deployed along with the
# on disk location are below. If changed, these settings must be applied # on disk location are below. If changed, these settings must be applied
# to both the baremetal and localhost groups. If the file is already on # to both the baremetal and localhost groups. If the file is already on
# disk, then the image generation will not take place, otherwise an image # disk, then the image generation will not take place, otherwise an image
# will be generated using diskimage-builder. # will be generated using diskimage-builder.
#deploy_image_filename: "deployment_image.qcow2" # deploy_image_filename: "deployment_image.qcow2"
#deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" # deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"
# Setting to utilize diskimage-builder to create a bootable image. # Setting to utilize diskimage-builder to create a bootable image.
create_image_via_dib: true create_image_via_dib: true
# Transform boot image is intended for use with the Ubuntu trusty image. It makes the image bootable by installing Grub. # Transform boot image is intended for use with the Ubuntu trusty image.
# It makes the image bootable by installing Grub.
# Setting to prepend a partition image with a boot sector and partition table. # Setting to prepend a partition image with a boot sector and partition table.
transform_boot_image: false transform_boot_image: false
# Create IPA image instead of downloading an pre-made CoreOS IPA image. # Create IPA image instead of downloading an pre-made CoreOS IPA image.
create_ipa_image: false create_ipa_image: false
# Dnsmasq default route for clients. If not defined, dnsmasq will push to clients # Dnsmasq default route for clients. If not defined, dnsmasq will push to
# as default route the same IP of the dnsmasq server. # clients as default route the same IP of the dnsmasq server.
# Default: undefined # Default: undefined
# dnsmasq_router: {{ ipv4_gateway }} # dnsmasq_router: {{ ipv4_gateway }}

View File

@ -15,12 +15,12 @@
- name: "Identify ssh_public_key if ssh_public_key_path is defined" - name: "Identify ssh_public_key if ssh_public_key_path is defined"
include: ssh_public_key_path.yaml include: ssh_public_key_path.yaml
when: ssh_public_key is undefined and ssh_public_key_path is defined when: ssh_public_key is undefined and ssh_public_key_path is defined
- name: "Name Make Temporary folder to build configdrive" - name: "Make temporary folder to build configdrive"
local_action: command mktemp -d local_action: command mktemp -d
register: variable_configdrive_location register: variable_configdrive_location
- name: "Make Metadata folder - /openstack/{{ metadata_version }}" - name: "Make metadata folder - /openstack/{{ metadata_version }}"
local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/{{ metadata_version }}/ local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/{{ metadata_version }}/
- name: "Make Metadata folder - /openstack/latest" - name: "Make metadata folder - /openstack/latest"
local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/latest/ local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/latest/
- name: "Place template in each openstack/{{ metadata_version }} folder" - name: "Place template in each openstack/{{ metadata_version }} folder"
local_action: template src=openstack_meta_data.json.j2 dest={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/{{ metadata_version }}/meta_data.json local_action: template src=openstack_meta_data.json.j2 dest={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/{{ metadata_version }}/meta_data.json
@ -29,7 +29,7 @@
- name: "Place network info template in each openstack/latest folder" - name: "Place network info template in each openstack/latest folder"
local_action: template src=network_info.json.j2 dest={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/latest/network_info.json local_action: template src=network_info.json.j2 dest={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/latest/network_info.json
when: addressing_mode is undefined and '"dhcp" not in addressing_mode' when: addressing_mode is undefined and '"dhcp" not in addressing_mode'
- name: "Make Metadata folder - /openstack/latest" - name: "Make metadata folder - /openstack/latest"
local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/content/ local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/content/
- name: "Write network Debian style interface template" - name: "Write network Debian style interface template"
local_action: template src=interfaces.j2 dest={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/content/0000 local_action: template src=interfaces.j2 dest={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/content/0000

View File

@ -19,5 +19,5 @@
- name: "Defined ssh_public_key_path - Error if ssh_public_key_path is not valid" - name: "Defined ssh_public_key_path - Error if ssh_public_key_path is not valid"
local_action: fail msg="ssh_public_key_path is not valid." local_action: fail msg="ssh_public_key_path is not valid."
when: test_ssh_public_key_path.stat.exists == false when: test_ssh_public_key_path.stat.exists == false
- name: "Defined ssh_public_key_path - Read ssh public key in" - name: "Defined ssh_public_key_path - Read SSH public key in"
set_fact: ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}" set_fact: ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}"

View File

@ -13,35 +13,35 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
--- ---
- name: "Extracting the raw disk image" - name: "Extract the raw disk image"
command: qemu-img convert -O raw "{{deploy_image}}" "{{deploy_image}}.raw" command: qemu-img convert -O raw "{{deploy_image}}" "{{deploy_image}}.raw"
- name: "Copying Image however with 32k of empty space at the beginning of the file." - name: "Copy image however with 32k of empty space at the beginning of the file."
command: dd if="{{deploy_image}}.raw" of="{{deploy_image}}.bootimg" seek=64 command: dd if="{{deploy_image}}.raw" of="{{deploy_image}}.bootimg" seek=64
- name: "Creating Partition Table lining up with the copied file's contents." - name: "Create partition table lining up with the copied file's contents."
shell: echo '32;' | sfdisk "{{deploy_image}}.bootimg" -uB -f shell: echo '32;' | sfdisk "{{deploy_image}}.bootimg" -uB -f
- name: "Allocating one of two loopbacks" - name: "Allocate one of two loopbacks"
command: losetup -f command: losetup -f
register: stored_value_loopback_alpha register: stored_value_loopback_alpha
- name: "Creating loopback connetion to new image file" - name: "Create loopback connetion to new image file"
command: losetup "{{stored_value_loopback_alpha.stdout}}" "{{deploy_image}}.bootimg" command: losetup "{{stored_value_loopback_alpha.stdout}}" "{{deploy_image}}.bootimg"
- name: "Forcing partition table to be re-read" - name: "Force partition table to be re-read"
command: kpartx -v -a "{{stored_value_loopback_alpha.stdout}}" command: kpartx -v -a "{{stored_value_loopback_alpha.stdout}}"
# Using second loopback as for some reason /dev/mapper does not translate into a chroot cleanly when devfs is mounted # Using second loopback as for some reason /dev/mapper does not translate into a chroot cleanly when devfs is mounted
- name: "Allocating second loopback pointing to the initial partition" - name: "Allocate second loopback pointing to the initial partition"
command: losetup -f command: losetup -f
register: stored_value_loopback_beta register: stored_value_loopback_beta
- name: "Binding second loopback to the first partition" - name: "Bind second loopback to the first partition"
shell: losetup "{{stored_value_loopback_beta.stdout}}" /dev/mapper/$(echo "{{stored_value_loopback_alpha.stdout}}"|cut -f3 -d '/')p1 shell: losetup "{{stored_value_loopback_beta.stdout}}" /dev/mapper/$(echo "{{stored_value_loopback_alpha.stdout}}"|cut -f3 -d '/')p1
# TODO parameterize folder name/location # TODO parameterize folder name/location
- name: "Ensuring we have a location to mount the disk to" - name: "Ensure we have a location to mount the disk to"
file: path=/mnt/bootimg state=directory file: path=/mnt/bootimg state=directory
- name: "Mounting volume on /mnt/bootimg" - name: "Mount volume on /mnt/bootimg"
command: mount "{{stored_value_loopback_beta.stdout}}" /mnt/bootimg command: mount "{{stored_value_loopback_beta.stdout}}" /mnt/bootimg
- name: "Binding /sys into /mnt/bootimg/sys" - name: "Bind /sys into /mnt/bootimg/sys"
command: mount -t sysfs sysfs /mnt/bootimg/sys command: mount -t sysfs sysfs /mnt/bootimg/sys
- name: "Binding /proc into /mnt/bootimg/proc" - name: "Bind /proc into /mnt/bootimg/proc"
command: mount -t proc proc /mnt/bootimg/proc command: mount -t proc proc /mnt/bootimg/proc
- name: "Binding /dev into /mnt/bootimg/dev" - name: "Bind /dev into /mnt/bootimg/dev"
command: mount --bind /dev /mnt/bootimg/dev command: mount --bind /dev /mnt/bootimg/dev
- name: "Disable Grub Prober" - name: "Disable Grub Prober"
shell: echo "GRUB_DISABLE_OS_PROBER=true" >>/etc/default/grub shell: echo "GRUB_DISABLE_OS_PROBER=true" >>/etc/default/grub
@ -55,15 +55,15 @@
command: umount /mnt/bootimg/proc command: umount /mnt/bootimg/proc
- name: "Unlink /dev/bootimg/sys" - name: "Unlink /dev/bootimg/sys"
command: umount /mnt/bootimg/sys command: umount /mnt/bootimg/sys
- name: "Unmounting image" - name: "Unmount image"
command: umount /mnt/bootimg command: umount /mnt/bootimg
- name: "Detaching second loop device" - name: "Detach second loop device"
command: losetup -d "{{stored_value_loopback_beta.stdout}}" command: losetup -d "{{stored_value_loopback_beta.stdout}}"
- name: "Removing partition map" - name: "Remove partition map"
command: kpartx -v -d "{{stored_value_loopback_alpha.stdout}}" command: kpartx -v -d "{{stored_value_loopback_alpha.stdout}}"
- name: "Detaching first loop device" - name: "Detach first loop device"
command: losetup -d "{{stored_value_loopback_alpha.stdout}}" command: losetup -d "{{stored_value_loopback_alpha.stdout}}"
- name: "Moving image to .oldimg" - name: "Move image to .oldimg"
command: mv "{{deploy_image}}" "{{deploy_image}}.oldimg" command: mv "{{deploy_image}}" "{{deploy_image}}.oldimg"
- name: "Moving new image into place" - name: "Move new image into place"
command: mv "{{deploy_image}}.bootimg" "{{deploy_image}}" command: mv "{{deploy_image}}.bootimg" "{{deploy_image}}"

View File

@ -16,6 +16,6 @@
- name: "Test if deploy image is present" - name: "Test if deploy image is present"
stat: path={{ deploy_image }} stat: path={{ deploy_image }}
register: test_image_present register: test_image_present
- name: "Creating bootable image" - name: "Create bootable image"
include: create_bootable_image.yml include: create_bootable_image.yml
when: test_image_present.stat.exists == true when: test_image_present.stat.exists == true

View File

@ -18,7 +18,7 @@
# sudo NODEBASE=junk NODECOUNT=3 create_nodes.sh # sudo NODEBASE=junk NODECOUNT=3 create_nodes.sh
# #
# THANKS # THANKS
# Thanks to the author(s) of the Ironic supporting code within devstack, # Thanks to the author(s) of the ironic-supporting code within devstack,
# from which all of this is derived. # from which all of this is derived.
# #
# AUTHOR # AUTHOR
@ -72,8 +72,8 @@ function create_node {
NAME=$1 NAME=$1
CPU=$2 CPU=$2
MEM=$(( 1024 * $3 )) MEM=$(( 1024 * $3 ))
# extra G to allow fuzz for partition table : flavor size and registered size # extra G to allow fuzz for partition table : flavor size and registered
# need to be different to actual size. # size need to be different to actual size.
DISK=$(( $4 + 1)) DISK=$(( $4 + 1))
case $5 in case $5 in
@ -105,9 +105,9 @@ function create_node {
if [ -n "$LOGDIR" ] ; then if [ -n "$LOGDIR" ] ; then
mkdir -p "$LOGDIR" mkdir -p "$LOGDIR"
if [ -e /etc/centos-release ]; then if [ -e /etc/centos-release ]; then
# NOTE(TheJulia): For some unknown reason, libvirt's log folder permissions # NOTE(TheJulia): For some unknown reason, libvirt's log folder
# on CentOS ship in an inoperable state. Users must be able to read a folder # permissions on CentOS ship in an inoperable state. Users must
# to open files in the folder structure. # be able to read a folder to open files in the folder structure.
chmod o+rx "$LOGDIR/.." chmod o+rx "$LOGDIR/.."
fi fi
fi fi
@ -129,7 +129,7 @@ function create_node {
touch "$volume_path" touch "$volume_path"
# NOTE(TheJulia): CentOS default installs with an XFS root, and chattr # NOTE(TheJulia): CentOS default installs with an XFS root, and chattr
# fails to set +C on XFS. This could be more elegent, however the use # fails to set +C on XFS. This could be more elegant, however the use
# case is for CI testing. # case is for CI testing.
if [ ! -e /etc/centos-release ]; then if [ ! -e /etc/centos-release ]; then
chattr +C "$volume_path" || true chattr +C "$volume_path" || true

View File

@ -17,7 +17,7 @@
- name: "Update apt cache if Ubuntu/Debian" - name: "Update apt cache if Ubuntu/Debian"
apt: update_cache=yes apt: update_cache=yes
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
- name: "Load Distribution defaults" - name: "Load distribution defaults"
include_vars: "{{ item }}" include_vars: "{{ item }}"
with_first_found: with_first_found:
- "../defaults/required_defaults_{{ ansible_distribution }}.yml" - "../defaults/required_defaults_{{ ansible_distribution }}.yml"
@ -52,8 +52,8 @@
command: virsh capabilities command: virsh capabilities
when: task_create_vm_nodes.rc != 0 when: task_create_vm_nodes.rc != 0
- name: "Abort due to failed VM creation" - name: "Abort due to failed VM creation"
fail: msg="VM Creation step failed, please review dmesg output for additional details" fail: msg="VM creation step failed, please review dmesg output for additional details"
when: task_create_vm_nodes.rc != 0 when: task_create_vm_nodes.rc != 0
- name: "Setting file permissions such that the baremetal csv file at /tmp/baremetal.csv can be read by the user executing Ansible" - name: "Set file permissions such that the baremetal csv file at /tmp/baremetal.csv can be read by the user executing Ansible"
file: path="{{baremetal_csv_file}}" owner="{{ansible_env.SUDO_USER}}" file: path="{{baremetal_csv_file}}" owner="{{ansible_env.SUDO_USER}}"
when: ansible_env.SUDO_USER is defined and baremetal_csv_file is defined and baremetal_csv_file != "" when: ansible_env.SUDO_USER is defined and baremetal_csv_file is defined and baremetal_csv_file != ""

View File

@ -17,7 +17,7 @@
# the pass-through could mean that the user could deploy # the pass-through could mean that the user could deploy
# things that are not directly accessible or reasonable # things that are not directly accessible or reasonable
# to be inspected. # to be inspected.
- name: "Deploy to Hardware - Using custom instance_info." - name: "Deploy to hardware - Using custom instance_info."
os_ironic_node: os_ironic_node:
auth_type: None auth_type: None
auth: None auth: None
@ -33,9 +33,9 @@
register: test_deploy_image register: test_deploy_image
when: instance_info is not defined when: instance_info is not defined
- name: "Error if deploy_image is not present, and instance_info is not defined" - name: "Error if deploy_image is not present, and instance_info is not defined"
fail: msg="The user defined deploy_image, which is the image to be written to the remote node(s) upon deployment, was not found. Cannot proceed." fail: msg="The user-defined deploy_image, which is the image to be written to the remote node(s) upon deployment, was not found. Cannot proceed."
when: test_deploy_image.stat.exists | bool == false and instance_info is not defined when: test_deploy_image.stat.exists | bool == false and instance_info is not defined
- name: "Deploy to Hardware - Bifrost Default" - name: "Deploy to hardware - bifrost default"
os_ironic_node: os_ironic_node:
auth_type: None auth_type: None
auth: None auth: None

View File

@ -1,6 +1,6 @@
--- ---
# Cleaning turns on ironic conductor clean_nodes flag # Cleaning turns on ironic conductor clean_nodes flag
# chich causes the nodes to be wiped after deletion. # which causes the nodes to be wiped after deletion.
cleaning: false cleaning: false
http_boot_folder: /httpboot http_boot_folder: /httpboot
nginx_port: 8080 nginx_port: 8080
@ -27,7 +27,7 @@ use_cirros: false
# Download IPA by default # Download IPA by default
download_ipa: true download_ipa: true
cirros_deploy_image_upstream_url: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img cirros_deploy_image_upstream_url: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
# By default Bifrost will deploy dnsmasq to utilize as an integrated DHCP # By default bifrost will deploy dnsmasq to utilize as an integrated DHCP
# server. If you already have a DHCP server, you will need to disable # server. If you already have a DHCP server, you will need to disable
# this setting, and perform manual configuration of your DHCP server. # this setting, and perform manual configuration of your DHCP server.
include_dhcp_server: true include_dhcp_server: true
@ -43,12 +43,12 @@ ironic_git_folder: /opt/stack/ironic
ironicclient_git_folder: /opt/stack/python-ironicclient ironicclient_git_folder: /opt/stack/python-ironicclient
shade_git_folder: /opt/stack/shade shade_git_folder: /opt/stack/shade
dib_git_folder: /opt/stack/diskimage-builder dib_git_folder: /opt/stack/diskimage-builder
# Comma separated list, in the format of a string, of drivers that are enabled. # Comma-separated list, in the format of a string, of drivers that are enabled.
enabled_drivers: "agent_ipmitool,pxe_amt,agent_ilo,agent_ucs" enabled_drivers: "agent_ipmitool,pxe_amt,agent_ilo,agent_ucs"
# DHCP pool for requests. # DHCP pool for requests.
dhcp_pool_start: 192.168.1.200 dhcp_pool_start: 192.168.1.200
dhcp_pool_end: 192.168.1.250 dhcp_pool_end: 192.168.1.250
# Default network interface that Bifrost will be attached to. # Default network interface that bifrost will be attached to.
network_interface: "virbr0" network_interface: "virbr0"
# Dnsmasq default route for clients. If not defined, dnsmasq will push to clients # Dnsmasq default route for clients. If not defined, dnsmasq will push to clients
# as default route the same IP of the dnsmasq server. # as default route the same IP of the dnsmasq server.

View File

@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
--- ---
- name: "Setting up PXE and iPXE folders" - name: "Set up PXE and iPXE folders"
file: name={{item}} owner=ironic group=ironic state=directory file: name={{item}} owner=ironic group=ironic state=directory
with_items: with_items:
- /tftpboot - /tftpboot
- /tftpboot/pxelinux.cfg - /tftpboot/pxelinux.cfg
- "{{ http_boot_folder }}" - "{{ http_boot_folder }}"
- name: "Placing tftpd map-file" - name: "Place tftpd map-file"
copy: src=tftpboot-map-file dest=/tftpboot/map-file owner=ironic group=ironic copy: src=tftpboot-map-file dest=/tftpboot/map-file owner=ironic group=ironic
- name: "Disable service tftpd-hpa" - name: "Disable service tftpd-hpa"
service: name=tftpd-hpa state=stopped enabled=no service: name=tftpd-hpa state=stopped enabled=no
@ -30,7 +30,7 @@
- name: "Determine if pxelinux.0 is in place" - name: "Determine if pxelinux.0 is in place"
stat: path=/tftpboot/pxelinux.0 stat: path=/tftpboot/pxelinux.0
register: test_pxelinux register: test_pxelinux
- name: "Placing pxelinux.0" - name: "Place pxelinux.0"
copy: src={{ syslinux_tftp_dir }}/pxelinux.0 dest=/tftpboot copy: src={{ syslinux_tftp_dir }}/pxelinux.0 dest=/tftpboot
when: test_pxelinux.stat.exists == false when: test_pxelinux.stat.exists == false
- name: "Place boot.ipxe helper script to HTTP root" - name: "Place boot.ipxe helper script to HTTP root"

View File

@ -13,5 +13,5 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
--- ---
- name: "DIB - Installing patched library." - name: "DIB - Install patched library."
command: pip install --force-reinstall "{{ dib_git_folder }}" command: pip install --force-reinstall "{{ dib_git_folder }}"

View File

@ -40,21 +40,21 @@
when: testing | bool == false when: testing | bool == false
- name: "For agent, Log to screen" - name: "For agent, Log to screen"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[agent]" regexp='^(.*)agent_pxe_append_params=(.*)$' line="agent_pxe_append_params=systemd.journald.forward_to_console=yes" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[agent]" regexp='^(.*)agent_pxe_append_params=(.*)$' line="agent_pxe_append_params=systemd.journald.forward_to_console=yes"
- name: "For agent, place agent pxe template" - name: "For agent, place agent PXE template"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[agent]" regexp='^(.*)agent_pxe_config_template=(.*)$' line="agent_pxe_config_template=/etc/ironic/agent_config.template" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[agent]" regexp='^(.*)agent_pxe_config_template=(.*)$' line="agent_pxe_config_template=/etc/ironic/agent_config.template"
- name: "Configure conductor api url" - name: "Configure conductor API url"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[conductor]" regexp='^(.*)api_url=(.*)$' line="api_url=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:6385/" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[conductor]" regexp='^(.*)api_url=(.*)$' line="api_url=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:6385/"
- name: "Configure conductor cleaning" - name: "Configure conductor cleaning"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[conductor]" regexp='^(.*)clean_nodes=(.*)$' line="clean_nodes={{ cleaning | lower }}" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[conductor]" regexp='^(.*)clean_nodes=(.*)$' line="clean_nodes={{ cleaning | lower }}"
- name: "Configure database connection" - name: "Configure database connection"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[database]" regexp='^(.*)connection=(.*)$' line="connection=mysql://ironic:{{ ironic_db_password }}@localhost/ironic?charset=utf8" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[database]" regexp='^(.*)connection=(.*)$' line="connection=mysql://ironic:{{ ironic_db_password }}@localhost/ironic?charset=utf8"
- name: "Configure dhcp provider" - name: "Configure DHCP provider"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[dhcp]" regexp='^(.*)dhcp_provider=(.*)$' line="dhcp_provider=none" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[dhcp]" regexp='^(.*)dhcp_provider=(.*)$' line="dhcp_provider=none"
- name: "Set pxe pxe_config_template" - name: "Set PXE pxe_config_template"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)pxe_config_template=(.*)$' line="pxe_config_template=$pybasedir/drivers/modules/ipxe_config.template" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)pxe_config_template=(.*)$' line="pxe_config_template=$pybasedir/drivers/modules/ipxe_config.template"
- name: "Set pxe tftp_server" - name: "Set PXE tftp_server"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)tftp_server=(.*)$' line="tftp_server={{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)tftp_server=(.*)$' line="tftp_server={{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}"
- name: "Set pxe tftp_root" - name: "Set PXE tftp_root"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)tftp_root=(.*)$' line="tftp_root=/tftpboot" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)tftp_root=(.*)$' line="tftp_root=/tftpboot"
- name: "Set iPXE pxe_bootfile_name" - name: "Set iPXE pxe_bootfile_name"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)pxe_bootfile_name=(.*)$' line="pxe_bootfile_name=undionly.kpxe" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)pxe_bootfile_name=(.*)$' line="pxe_bootfile_name=undionly.kpxe"
@ -66,6 +66,6 @@
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)ipxe_enabled=(.*)$' line="ipxe_enabled=true" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)ipxe_enabled=(.*)$' line="ipxe_enabled=true"
- name: "Set path to ipxe template file" - name: "Set path to ipxe template file"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)ipxe_boot_script=(.*)$' line="ipxe_boot_script=$pybasedir/drivers/modules/boot.ipxe" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)ipxe_boot_script=(.*)$' line="ipxe_boot_script=$pybasedir/drivers/modules/boot.ipxe"
- name: "Configure ssh libvirt URL if testing" - name: "Configure SSH libvirt URL if testing"
lineinfile: dest=/etc/ironic/ironic.conf insertafter="[ssh]" regexp='^(.*)libvirt_uri=(.*)$' line="libvirt_uri=qemu:///system" lineinfile: dest=/etc/ironic/ironic.conf insertafter="[ssh]" regexp='^(.*)libvirt_uri=(.*)$' line="libvirt_uri=qemu:///system"
when: testing | bool == true when: testing | bool == true

View File

@ -38,7 +38,7 @@
action: "{{ ansible_pkg_mgr }} name={{ item }}" action: "{{ ansible_pkg_mgr }} name={{ item }}"
with_items: required_packages with_items: required_packages
# Step required for Ubuntu 14.10 # Step required for Ubuntu 14.10
- name: "Install 14.10 packages" - name: "Install Ubuntu 14.10 (and later) packages"
action: "{{ ansible_pkg_mgr }} name={{ item }}" action: "{{ ansible_pkg_mgr }} name={{ item }}"
with_items: with_items:
- pxelinux - pxelinux
@ -46,7 +46,7 @@
# NOTE(TheJulia) While we don't necessarilly require /opt/stack any longer # NOTE(TheJulia) While we don't necessarilly require /opt/stack any longer
# and it should already be created by the Ansible setup, we will leave this # and it should already be created by the Ansible setup, we will leave this
# here for the time being. # here for the time being.
- name: "Ensuring /opt/stack is present" - name: "Ensure /opt/stack is present"
file: name=/opt/stack state=directory owner=root group=root file: name=/opt/stack state=directory owner=root group=root
- name: "Ironic Client - Install from source if configured to do so." - name: "Ironic Client - Install from source if configured to do so."
command: pip install --force-reinstall {{ ironicclient_git_folder }} command: pip install --force-reinstall {{ ironicclient_git_folder }}
@ -72,76 +72,76 @@
- name: "Include diskimage-builder installation" - name: "Include diskimage-builder installation"
include: dib_install.yml include: dib_install.yml
when: create_image_via_dib == true when: create_image_via_dib == true
- name: "Starting database service" - name: "Start database service"
service: name={{ mysql_service_name }} state=started service: name={{ mysql_service_name }} state=started
- name: "Starting rabbitmq-server" - name: "Start rabbitmq-server"
service: name=rabbitmq-server state=started service: name=rabbitmq-server state=started
- name: "RabbitMQ - Testing if hostname is defined firsts in /etc/hosts" - name: "RabbitMQ - Testing if hostname is defined in /etc/hosts"
command: grep -i "127.0.0.1.*{{ ansible_hostname }}\ localhost" /etc/hosts command: grep -i "127.0.0.1.*{{ ansible_hostname }}\ localhost" /etc/hosts
ignore_errors: yes ignore_errors: yes
register: test_grep_fix_hostname register: test_grep_fix_hostname
- name: "RabbitMQ - Fixing /etc/hosts" - name: "RabbitMQ - Fixing /etc/hosts"
command: sed -i 's/localhost/{{ ansible_hostname }} localhost/' /etc/hosts command: sed -i 's/localhost/{{ ansible_hostname }} localhost/' /etc/hosts
when: test_grep_fix_hostname.rc != 0 when: test_grep_fix_hostname.rc != 0
- name: "Ensuring guest user is removed from rabbitmq" - name: "Ensure guest user is removed from rabbitmq"
rabbitmq_user: user=guest state=absent force=yes rabbitmq_user: user=guest state=absent force=yes
- name: "Creating Ironic user in RabbitMQ" - name: "Create ironic user in RabbitMQ"
rabbitmq_user: user=ironic password={{ ironic_db_password }} force=yes state=present configure_priv=.* write_priv=.* read_priv=.* rabbitmq_user: user=ironic password={{ ironic_db_password }} force=yes state=present configure_priv=.* write_priv=.* read_priv=.*
no_log: true no_log: true
- name: "MySQL - Creating DB" - name: "MySQL - Create database"
mysql_db: login_user={{ mysql_username }} login_password={{ mysql_password }} name=ironic state=present encoding=utf8 mysql_db: login_user={{ mysql_username }} login_password={{ mysql_password }} name=ironic state=present encoding=utf8
register: test_created_db register: test_created_db
- name: "MySQL - Creating user for Ironic" - name: "MySQL - Create user for ironic"
mysql_user: login_user={{ mysql_username }} login_password={{ mysql_password }} name=ironic password={{ ironic_db_password }} priv=ironic.*:ALL state=present mysql_user: login_user={{ mysql_username }} login_password={{ mysql_password }} name=ironic password={{ ironic_db_password }} priv=ironic.*:ALL state=present
- name: "Install Ironic using pip" - name: "Install ironic using pip"
pip: name={{ ironic_git_folder }} state=latest pip: name={{ ironic_git_folder }} state=latest
when: skip_install is not defined when: skip_install is not defined
- name: "Creating an ironic service group" - name: "Create an ironic service group"
group: name=ironic group: name=ironic
- name: "Creating an ironic service user" - name: "Create an ironic service user"
user: name=ironic group=ironic user: name=ironic group=ironic
- name: "Ensure /etc/ironic exists" - name: "Ensure /etc/ironic exists"
file: name=/etc/ironic state=directory owner=ironic group=ironic mode=0755 file: name=/etc/ironic state=directory owner=ironic group=ironic mode=0755
- name: "Generate Ironic Configuration" - name: "Generate ironic Configuration"
include: ironic_config.yml include: ironic_config.yml
- name: "Place Ironic IPA Agent PXE configuration file" - name: "Place ironic IPA Agent PXE configuration file"
template: src=agent_config.template.j2 dest=/etc/ironic/agent_config.template owner=ironic group=ironic mode=0644 template: src=agent_config.template.j2 dest=/etc/ironic/agent_config.template owner=ironic group=ironic mode=0644
- name: "Copy policy.json to /etc/ironic" - name: "Copy policy.json to /etc/ironic"
copy: src="{{ ironic_git_folder }}/etc/ironic/policy.json" dest=/etc/ironic/ owner=ironic group=ironic mode=0644 copy: src="{{ ironic_git_folder }}/etc/ironic/policy.json" dest=/etc/ironic/ owner=ironic group=ironic mode=0644
- name: "Creating Ironic DB Schema" - name: "Create ironic DB Schema"
command: ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema command: ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema
when: test_created_db.changed == true when: test_created_db.changed == true
- name: "Upgrading Ironic DB Schema" - name: "Upgrade ironic DB Schema"
command: ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade command: ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade
when: test_created_db.changed == false when: test_created_db.changed == false
- name: "Do RedHat-specific changes for libvirt" - name: "Do RedHat-specific changes for libvirt"
include: redhat_libvirt_changes.yml include: redhat_libvirt_changes.yml
when: ansible_os_family == 'RedHat' when: ansible_os_family == 'RedHat'
- name: "Adding ironic user to virtualization group" - name: "Add ironic user to virtualization group"
user: name=ironic group="{{ virt_group }}" append=yes user: name=ironic group="{{ virt_group }}" append=yes
when: testing == true when: testing == true
- name: "Creating SSH directory for ironic user" - name: "Create SSH directory for ironic user"
local_action: file path=/home/ironic/.ssh owner=ironic group=ironic mode=0700 state=directory local_action: file path=/home/ironic/.ssh owner=ironic group=ironic mode=0700 state=directory
when: testing == true when: testing == true
- name: "Checking for ironic user SSH key" - name: "Check for ironic user SSH key"
local_action: stat path=/home/ironic/.ssh/id_rsa local_action: stat path=/home/ironic/.ssh/id_rsa
register: test_ironic_pvt_key register: test_ironic_pvt_key
- name: "Generating SSH key for ironic user" - name: "Generate SSH key for ironic user"
local_action: command ssh-keygen -f /home/ironic/.ssh/id_rsa -N "" local_action: command ssh-keygen -f /home/ironic/.ssh/id_rsa -N ""
when: testing == true and test_ironic_pvt_key.stat.exists == false when: testing == true and test_ironic_pvt_key.stat.exists == false
- name: "Setting ownership on ironic SSH private key" - name: "Set ownership on ironic SSH private key"
local_action: file name=/home/ironic/.ssh/id_rsa owner=ironic group=ironic mode=0600 state=file local_action: file name=/home/ironic/.ssh/id_rsa owner=ironic group=ironic mode=0600 state=file
when: testing == true and test_ironic_pvt_key.stat.exists == false when: testing == true and test_ironic_pvt_key.stat.exists == false
- name: "Setting ownership on ironic SSH public key" - name: "Set ownership on ironic SSH public key"
local_action: file name=/home/ironic/.ssh/id_rsa.pub owner=ironic group=ironic mode=0644 state=file local_action: file name=/home/ironic/.ssh/id_rsa.pub owner=ironic group=ironic mode=0644 state=file
when: testing == true and test_ironic_pvt_key.stat.exists == false when: testing == true and test_ironic_pvt_key.stat.exists == false
- name: "Creating authorized_keys file for ironic user" - name: "Create authorized_keys file for ironic user"
command: cp -p /home/ironic/.ssh/id_rsa.pub /home/ironic/.ssh/authorized_keys command: cp -p /home/ironic/.ssh/id_rsa.pub /home/ironic/.ssh/authorized_keys
when: testing == true when: testing == true
- name: "Get ironic-api & ironic-conductor install location" - name: "Get ironic-api & ironic-conductor install location"
shell: echo $(dirname $(which ironic-api)) shell: echo $(dirname $(which ironic-api))
register: ironic_install_prefix register: ironic_install_prefix
- name: "Placing services" - name: "Place services"
template: src={{ init_template }} dest={{ init_dest_dir }}{{item.service_name}}{{ init_ext }} owner=root group=root template: src={{ init_template }} dest={{ init_dest_dir }}{{item.service_name}}{{ init_ext }} owner=root group=root
with_items: with_items:
- { service_path: "{{ ironic_install_prefix.stdout }}", service_name: 'ironic-api', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'} - { service_path: "{{ ironic_install_prefix.stdout }}", service_name: 'ironic-api', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
@ -165,50 +165,50 @@
# NOTE(Shrews) When testing, we want to use our custom dnsmasq.conf file, # NOTE(Shrews) When testing, we want to use our custom dnsmasq.conf file,
# not the one supplied by libvirt. And the libvirt started dnsmasq processes # not the one supplied by libvirt. And the libvirt started dnsmasq processes
# are not controlled by upstart, so we need to manually kill those. # are not controlled by upstart, so we need to manually kill those.
- name: "Looking for libvirt dnsmasq config" - name: "Look for libvirt dnsmasq config"
stat: path=/etc/dnsmasq.d/libvirt-bin stat: path=/etc/dnsmasq.d/libvirt-bin
register: test_libvirt_dnsmasq register: test_libvirt_dnsmasq
when: "{{include_dhcp_server|bool}}" when: "{{include_dhcp_server|bool}}"
- name: "Disabling libvirt dnsmasq config" - name: "Disable libvirt dnsmasq config"
command: mv /etc/dnsmasq.d/libvirt-bin /etc/dnsmasq.d/libvirt-bin~ command: mv /etc/dnsmasq.d/libvirt-bin /etc/dnsmasq.d/libvirt-bin~
when: "{{include_dhcp_server|bool and test_libvirt_dnsmasq.stat.exists|bool and testing|bool}}" when: "{{include_dhcp_server|bool and test_libvirt_dnsmasq.stat.exists|bool and testing|bool}}"
- name: "Stopping existing libvirt dnsmasq processes" - name: "Stop existing libvirt dnsmasq processes"
command: killall -w dnsmasq command: killall -w dnsmasq
when: "{{testing|bool and include_dhcp_server|bool}}" when: "{{testing|bool and include_dhcp_server|bool}}"
# NOTE(Shrews) We need to enable ip forwarding for the libvirt bridge to # NOTE(Shrews) We need to enable ip forwarding for the libvirt bridge to
# operate properly with dnsmasq. This should be done before starting dnsmasq. # operate properly with dnsmasq. This should be done before starting dnsmasq.
- name: "Enabling IP forwarding in sysctl" - name: "Enable IP forwarding in sysctl"
sysctl: name="net.ipv4.ip_forward" value=1 sysctl_set=yes state=present reload=yes sysctl: name="net.ipv4.ip_forward" value=1 sysctl_set=yes state=present reload=yes
when: testing == true when: testing == true
# NOTE(Shrews) Ubuntu packaging+apparmor issue prevents libvirt from loading # NOTE(Shrews) Ubuntu packaging+apparmor issue prevents libvirt from loading
# the ROM from /usr/share/misc. # the ROM from /usr/share/misc.
- name: "Looking for sgabios in {{ sgabios_dir }}" - name: "Look for sgabios in {{ sgabios_dir }}"
stat: path={{ sgabios_dir }}/sgabios.bin stat: path={{ sgabios_dir }}/sgabios.bin
register: test_sgabios_qemu register: test_sgabios_qemu
- name: "Looking for sgabios in /usr/share/misc" - name: "Look for sgabios in /usr/share/misc"
stat: path=/usr/share/misc/sgabios.bin stat: path=/usr/share/misc/sgabios.bin
register: test_sgabios_misc register: test_sgabios_misc
- name: "Place sgabios.bin" - name: "Place sgabios.bin"
command: cp /usr/share/misc/sgabios.bin /usr/share/qemu/sgabios.bin command: cp /usr/share/misc/sgabios.bin /usr/share/qemu/sgabios.bin
when: test_sgabios_qemu == false and test_sgabios_misc == true and testing == true when: test_sgabios_qemu == false and test_sgabios_misc == true and testing == true
- name: "Deploying nginx configuration file for serving HTTP requests" - name: "Deploy nginx configuration file for serving HTTP requests"
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf
- name: "Ensuring services are running with current config" - name: "Ensure services are running with current config"
service: name={{ item }} state=restarted service: name={{ item }} state=restarted
with_items: with_items:
- xinetd - xinetd
- nginx - nginx
- name: "Ensuring dnsmasq is running with current config" - name: "Ensure dnsmasq is running with current config"
service: name={{ item }} state=restarted service: name={{ item }} state=restarted
with_items: with_items:
- dnsmasq - dnsmasq
when: "{{include_dhcp_server|bool}}" when: "{{include_dhcp_server|bool}}"
- name: "Sending services a reload signal" - name: "Send services a reload signal"
service: name={{ item }} state=reloaded service: name={{ item }} state=reloaded
with_items: with_items:
- xinetd - xinetd
- nginx - nginx
- name: "Sending services a force-reload signal" - name: "Send services a force-reload signal"
service: name=dnsmasq state=restarted service: name=dnsmasq state=restarted
when: "{{include_dhcp_server|bool}}" when: "{{include_dhcp_server|bool}}"
- name: "Download Ironic Python Agent kernel & image" - name: "Download Ironic Python Agent kernel & image"

View File

@ -19,7 +19,7 @@
# access to libvirt is restricted to the root group via polkit. # access to libvirt is restricted to the root group via polkit.
- name: "Update libvirt configuration file on RedHat/CentOS so the libvirt group has access" - name: "Update libvirt configuration file on RedHat/CentOS so the libvirt group has access"
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp=^unix_sock_group line='unix_sock_group = "libvirt"' lineinfile: dest=/etc/libvirt/libvirtd.conf regexp=^unix_sock_group line='unix_sock_group = "libvirt"'
- name: "Changing libvirt authentication to none as RedHat/CentOS use polkit by default" - name: "Change libvirt authentication to none as RedHat/CentOS use polkit by default"
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp=^auth_unix_rw line='auth_unix_rw = "none"' lineinfile: dest=/etc/libvirt/libvirtd.conf regexp=^auth_unix_rw line='auth_unix_rw = "none"'
- name: "Changing libvirt socket permissions to be restricted on on RedHat/CentOS" - name: "Change libvirt socket permissions to be restricted on on RedHat/CentOS"
lineinfile: dest=/etc/libvirt/libvirtd.conf regexp=^unix_sock_rw_perms line='unix_sock_rw_perms = "0770"' lineinfile: dest=/etc/libvirt/libvirtd.conf regexp=^unix_sock_rw_perms line='unix_sock_rw_perms = "0770"'

View File

@ -1,3 +1,3 @@
--- ---
# Default location to the ssh public key for the user operating Bifrost. # Default location of the ssh public key for the user operating Bifrost.
ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"

View File

@ -47,7 +47,7 @@ try:
'-n', 'FETCH_HEAD'], stdout=True) is 0: '-n', 'FETCH_HEAD'], stdout=True) is 0:
print("Applied %s" % ref) print("Applied %s" % ref)
else: else:
print("Failed to cherry pick %s on to %s branch %s" print("Failed to cherry pick %s onto %s branch %s"
% (ref, repo_name, branch)) % (ref, repo_name, branch))
sys.exit(1) sys.exit(1)
else: else:

View File

@ -41,6 +41,6 @@
- name: "Create an SSH key for Jenkins user if operating in OpenStack CI" - name: "Create an SSH key for Jenkins user if operating in OpenStack CI"
shell: ssh-keygen -f ~/.ssh/id_rsa -N "" shell: ssh-keygen -f ~/.ssh/id_rsa -N ""
when: ci_testing_zuul is defined and test_ssh_public_key_path.stat.exists == false when: ci_testing_zuul is defined and test_ssh_public_key_path.stat.exists == false
- name: "Create an empty ssh known_hosts file for Jenkins user if operating in OpenStack CI" - name: "Create an empty SSH known_hosts file for Jenkins user if operating in OpenStack CI"
shell: touch ~/.ssh/known_hosts && chmod 600 ~/.ssh/known_hosts shell: touch ~/.ssh/known_hosts && chmod 600 ~/.ssh/known_hosts
when: ci_testing_zuul is defined and test_ssh_public_key_path.stat.exists == false when: ci_testing_zuul is defined and test_ssh_public_key_path.stat.exists == false

View File

@ -13,35 +13,35 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
--- ---
- name: "Downloading Ironic" - name: "Download ironic"
command: git clone {{ ironic_git_url }} {{ ironic_git_folder }} chdir={{ git_root }} creates={{ ironic_git_folder }} command: git clone {{ ironic_git_url }} {{ ironic_git_folder }} chdir={{ git_root }} creates={{ ironic_git_folder }}
- name: "Ironic - checking out branch" - name: "Ironic - check out branch"
command: git checkout -f {{ ironic_git_branch }} chdir={{ ironic_git_folder }} command: git checkout -f {{ ironic_git_branch }} chdir={{ ironic_git_folder }}
- name: "Ironic - resetting branch" - name: "Ironic - reset branch"
command: git reset --hard {{ ironic_git_branch }} chdir={{ ironic_git_folder }} command: git reset --hard {{ ironic_git_branch }} chdir={{ ironic_git_folder }}
- name: "Ironic - resyncing to current branch" - name: "Ironic - resync to current branch"
command: git pull --ff-only chdir={{ ironic_git_folder }} command: git pull --ff-only chdir={{ ironic_git_folder }}
- name: "python-ironicclient - Retrieving library from git.openstack.org" - name: "python-ironicclient - Retrieve library from git.openstack.org"
command: git clone {{ ironicclient_git_url }} {{ ironicclient_git_folder }} chdir={{ git_root }} creates={{ ironicclient_git_folder }} command: git clone {{ ironicclient_git_url }} {{ ironicclient_git_folder }} chdir={{ git_root }} creates={{ ironicclient_git_folder }}
- name: "python-ironicclient - Checking out branch" - name: "python-ironicclient - Check out branch"
command: git checkout -f {{ ironicclient_git_branch}} chdir={{ironicclient_git_folder}} command: git checkout -f {{ ironicclient_git_branch}} chdir={{ironicclient_git_folder}}
- name: "python-ironicclient - Resetting local repository" - name: "python-ironicclient - Reset local repository"
command: git reset --hard {{ ironicclient_git_branch }} chdir={{ ironicclient_git_folder }} command: git reset --hard {{ ironicclient_git_branch }} chdir={{ ironicclient_git_folder }}
- name: "python-ironicclient - Resyncing local repository" - name: "python-ironicclient - Resync local repository"
command: git pull --ff-only chdir={{ ironicclient_git_folder }} command: git pull --ff-only chdir={{ ironicclient_git_folder }}
- name: "Shade - Retrieving library from git.openstack.org" - name: "Shade - Retrieve library from git.openstack.org"
command: git clone {{ shade_git_url }} {{ shade_git_folder }} chdir={{ git_root }} creates={{ shade_git_folder }} command: git clone {{ shade_git_url }} {{ shade_git_folder }} chdir={{ git_root }} creates={{ shade_git_folder }}
- name: "Shade - Checking out branch" - name: "Shade - Check out branch"
command: git checkout -f {{ shade_git_branch }} chdir={{ shade_git_folder }} command: git checkout -f {{ shade_git_branch }} chdir={{ shade_git_folder }}
- name: "Shade - Resetting local repository" - name: "Shade - Reset local repository"
command: git reset --hard {{ shade_git_branch }} chdir={{ shade_git_folder }} command: git reset --hard {{ shade_git_branch }} chdir={{ shade_git_folder }}
- name: "Shade - Resyncing local repository" - name: "Shade - Resync local repository"
command: git pull --ff-only chdir={{ shade_git_folder }} command: git pull --ff-only chdir={{ shade_git_folder }}
- name: "Disk Image Builder - Retrieving from git.openstack.org" - name: "Disk Image Builder - Retrieve from git.openstack.org"
command: git clone {{ dib_git_url }} {{ dib_git_folder }} chdir={{ git_root }} creates={{ dib_git_folder }} command: git clone {{ dib_git_url }} {{ dib_git_folder }} chdir={{ git_root }} creates={{ dib_git_folder }}
- name: "Disk Image Builder - Checking out branch" - name: "Disk Image Builder - Check out branch"
command: git checkout -f {{ dib_git_branch }} chdir={{ dib_git_folder }} command: git checkout -f {{ dib_git_branch }} chdir={{ dib_git_folder }}
- name: "Disk Image Builder - Resetting local repository" - name: "Disk Image Builder - Reset local repository"
command: git reset --hard {{ dib_git_branch }} chdir={{ dib_git_folder }} command: git reset --hard {{ dib_git_branch }} chdir={{ dib_git_folder }}
- name: "Disk Image Builder - Resyncing local repository" - name: "Disk Image Builder - Resync local repository"
command: git pull --ff-only chdir={{ dib_git_folder }} command: git pull --ff-only chdir={{ dib_git_folder }}

View File

@ -12,19 +12,19 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
--- ---
- name: "Waiting for the base testvm machine to become available." - name: "Wait for the base testvm machine to become available."
wait_for: state=started port=22 host={{ ipv4_address }} timeout={{ wait_timeout }} wait_for: state=started port=22 host={{ ipv4_address }} timeout={{ wait_timeout }}
when: ipv4_address is defined when: ipv4_address is defined
- name: "Pausing for 4 seconds to allow testvm to become fully operational and to avoid any potential sshd startup race." - name: "Pause for 4 seconds to allow testvm to become fully operational and to avoid any potential sshd startup race."
# NOTE(TheJulia): AFAIK sshd opens it's socket and then loads/generates # NOTE(TheJulia): AFAIK sshd opens it's socket and then loads/generates
# keys, which can become visible as a race, hence the four second pause. # keys, which can become visible as a race, hence the four second pause.
pause: seconds={{ node_ssh_pause }} pause: seconds={{ node_ssh_pause }}
- name: "Adding testvm(s) to Ansible Inventory" - name: "Add testvm(s) to Ansible Inventory"
add_host: name="{{ ipv4_address }}:22" groups=test add_host: name="{{ ipv4_address }}:22" groups=test
when: ipv4_address is defined when: ipv4_address is defined
- name: "Removing testvm hosts from ssh known_hosts file." - name: "Remove testvm hosts from SSH known_hosts file."
command: ssh-keygen -R "{{ ipv4_address }}" command: ssh-keygen -R "{{ ipv4_address }}"
when: ipv4_address is defined when: ipv4_address is defined
- name: "Adding testvm hosts from ssh known_hosts file." - name: "Add testvm hosts from SSH known_hosts file."
shell: ssh-keyscan "{{ ipv4_address }}" >> "{{ ansible_env.HOME }}/.ssh/known_hosts" shell: ssh-keyscan "{{ ipv4_address }}" >> "{{ ansible_env.HOME }}/.ssh/known_hosts"
when: ipv4_address is defined when: ipv4_address is defined

View File

@ -15,7 +15,7 @@
- name: "Collect the checksum of the deployment image." - name: "Collect the checksum of the deployment image."
local_action: stat path={{deploy_image}} local_action: stat path={{deploy_image}}
register: test_deploy_image register: test_deploy_image
- name: "Deploy to Hardware" - name: "Deploy to hardware"
os_ironic_node: os_ironic_node:
auth_type: None auth_type: None
auth: None auth: None

View File

@ -19,13 +19,13 @@
register: instance_hostname register: instance_hostname
- name: 'Error if hostname is set to "ubuntu", "cirros", "debian", or "centos"' - name: 'Error if hostname is set to "ubuntu", "cirros", "debian", or "centos"'
# TODO: Presently this step is unable to cycle through each host and verify # TODO: Presently this step is unable to cycle through each host and verify
# it's hostname is properly set. Perhaps if there was some way to extract # its hostname is properly set. Perhaps if there was some way to extract
# the data on each host from Ironic's DB and then verify that information # the data on each host from ironic's DB and then verify that information
# as a host-level fact that can be verified. # as a host-level fact that can be verified.
# #
# TODO: As time goes on, we may move to leveraging inventory information # TODO: As time goes on, we may move to leveraging inventory information
# which will allow this role to do validation of the remote node. # which will allow this role to do validation of the remote node.
# NOTE(TheJulia): If we go down the path of additional validation, we need # NOTE(TheJulia): If we go down the path of additional validation, we need
# to keep things like Cirros in mind. # to keep things like Cirros in mind.
fail: msg='If this fails, the configdrive may not have been used as the hostname was set to the default.' fail: msg='Check if hostname was changed from the default value. If this fails, the configdrive may not have been used.'
when: '"ubuntu" in instance_hostname.stdout or "cirros" in instance_hostname.stdout or "debian" in instance_hostname.stdout or "centos" in instance_hostname.stdout' when: '"ubuntu" in instance_hostname.stdout or "cirros" in instance_hostname.stdout or "debian" in instance_hostname.stdout or "centos" in instance_hostname.stdout'

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
--- ---
- name: "Delete Hardware" - name: "Delete hardware"
os_ironic: os_ironic:
auth_type: None auth_type: None
auth: None auth: None

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
--- ---
- name: "Dynamic Enrollment" - name: "Dynamic enrollment"
os_ironic: os_ironic:
auth_type: None auth_type: None
auth: None auth: None