Merge "Add new lines to improve pre-install yaml files"

This commit is contained in:
Jenkins 2016-09-26 17:57:05 +00:00 committed by Gerrit Code Review
commit 6c7991d96b
6 changed files with 33 additions and 0 deletions

View File

@ -32,11 +32,13 @@
apt: apt:
update_cache: yes 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"
- "../defaults/required_defaults_{{ ansible_os_family }}.yml" - "../defaults/required_defaults_{{ ansible_os_family }}.yml"
- name: "Include OS version-specific defaults" - name: "Include OS version-specific defaults"
include_vars: "{{ item }}" include_vars: "{{ item }}"
with_first_found: with_first_found:
@ -45,26 +47,33 @@
# NOTE(cinerama): On Fedora 22, ansible 1.9, ansible_pkg_mgr # NOTE(cinerama): On Fedora 22, ansible 1.9, ansible_pkg_mgr
# defaults to yum, which may not be installed. This can be safely # defaults to yum, which may not be installed. This can be safely
# removed when we start using an ansible release which prefers dnf. # removed when we start using an ansible release which prefers dnf.
- name: "Check for dnf" - name: "Check for dnf"
stat: stat:
path: "/usr/bin/dnf" path: "/usr/bin/dnf"
register: test_dnf register: test_dnf
- name: "Adjust ansible_pkg_mgr if dnf exists" - name: "Adjust ansible_pkg_mgr if dnf exists"
set_fact: set_fact:
ansible_pkg_mgr: "dnf" ansible_pkg_mgr: "dnf"
when: ansible_distribution == 'Fedora' and "{{ test_dnf.stat.exists|bool }}" when: ansible_distribution == 'Fedora' and "{{ test_dnf.stat.exists|bool }}"
- name: "Install required packages" - name: "Install required packages"
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items: required_packages with_items: required_packages
- name: "Restart libvirt service" - name: "Restart libvirt service"
service: name="{{libvirt_service_name}}" state=restarted service: name="{{libvirt_service_name}}" state=restarted
- name: "Verify default network is running" - name: "Verify default network is running"
shell: virsh net-info default |grep Active|grep -q yes shell: virsh net-info default |grep Active|grep -q yes
register: virsh_network_status register: virsh_network_status
ignore_errors: yes ignore_errors: yes
- name: "Start default network if not running" - name: "Start default network if not running"
command: virsh net-start default command: virsh net-start default
when: virsh_network_status.rc != 0 when: virsh_network_status.rc != 0
- name: "Create virtual machines" - name: "Create virtual machines"
script: create_vm_nodes-for-role.sh script: create_vm_nodes-for-role.sh
environment: environment:
@ -75,19 +84,23 @@
register: task_create_vm_nodes register: task_create_vm_nodes
ignore_errors: yes ignore_errors: yes
delegate_to: localhost delegate_to: localhost
- name: "Execute `dmesg` to collect debugging output should VM creation fail." - name: "Execute `dmesg` to collect debugging output should VM creation fail."
command: dmesg command: dmesg
when: task_create_vm_nodes.rc != 0 when: task_create_vm_nodes.rc != 0
- name: > - name: >
"Execute `virsh capabilities` to collect debugging output "Execute `virsh capabilities` to collect debugging output
should VM creation fail." should VM creation fail."
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: > fail: >
msg="VM creation step failed, please review dmesg msg="VM creation step failed, please review dmesg
output for additional details" output for additional details"
when: task_create_vm_nodes.rc != 0 when: task_create_vm_nodes.rc != 0
- name: > - name: >
"Set file permissions such that the baremetal csv file at /tmp/baremetal.csv "Set file permissions such that the baremetal csv file at /tmp/baremetal.csv
can be read by the user executing Ansible" can be read by the user executing Ansible"

View File

@ -21,15 +21,18 @@
mysql_password: "openstack_citest" mysql_password: "openstack_citest"
disable_dnsmasq_dns: True disable_dnsmasq_dns: True
when: ci_testing_zuul_changes is defined when: ci_testing_zuul_changes is defined
- name: "Determine if OpenStack CI is missing an SSH key" - name: "Determine if OpenStack CI is missing an SSH key"
stat: path={{ssh_public_key_path}} stat: path={{ssh_public_key_path}}
register: test_ssh_public_key_path register: test_ssh_public_key_path
when: ci_testing_zuul is defined when: ci_testing_zuul is defined
- 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: > when: >
ci_testing_zuul is defined and ci_testing_zuul is defined and
test_ssh_public_key_path.stat.exists |bool == false test_ssh_public_key_path.stat.exists |bool == false
- name: > - name: >
"Create an empty SSH known_hosts file for Jenkins user "Create an empty SSH known_hosts file for Jenkins user
if operating in OpenStack CI" if operating in OpenStack CI"

View File

@ -15,9 +15,12 @@
--- ---
- name: "Clone repository" - name: "Clone repository"
command: git clone {{ git_url }} {{ git_folder }} chdir={{ git_root }} creates={{ git_folder }} command: git clone {{ git_url }} {{ git_folder }} chdir={{ git_root }} creates={{ git_folder }}
- name: "Check out branch" - name: "Check out branch"
command: git checkout -f {{ git_branch }} chdir={{ git_folder }} command: git checkout -f {{ git_branch }} chdir={{ git_folder }}
- name: "Reset local repository" - name: "Reset local repository"
command: git reset --hard {{ git_branch }} chdir={{ git_folder }} command: git reset --hard {{ git_branch }} chdir={{ git_folder }}
- name: "Resync local repository" - name: "Resync local repository"
command: git pull --ff-only chdir={{ git_folder }} command: git pull --ff-only chdir={{ git_folder }}

View File

@ -15,13 +15,18 @@
--- ---
- name: "ironic - Copy into place" - name: "ironic - Copy into place"
command: cp -a {{ ironic_git_url }} {{ ironic_git_folder }} chdir={{ git_root }} creates={{ ironic_git_folder }} command: cp -a {{ ironic_git_url }} {{ ironic_git_folder }} chdir={{ git_root }} creates={{ ironic_git_folder }}
- name: "python-ironicclient - Copy into place" - name: "python-ironicclient - Copy into place"
command: cp -a {{ ironicclient_git_url }} {{ ironicclient_git_folder }} chdir={{ git_root }} creates={{ ironicclient_git_folder }} command: cp -a {{ ironicclient_git_url }} {{ ironicclient_git_folder }} chdir={{ git_root }} creates={{ ironicclient_git_folder }}
- name: "Shade - Copy into place" - name: "Shade - Copy into place"
command: cp -a {{ shade_git_url }} {{ shade_git_folder }} chdir={{ git_root }} creates={{ shade_git_folder }} command: cp -a {{ shade_git_url }} {{ shade_git_folder }} chdir={{ git_root }} creates={{ shade_git_folder }}
- name: "Disk Image Builder - Copy into place" - name: "Disk Image Builder - Copy into place"
command: cp -a {{ dib_git_url }} {{ dib_git_folder }} chdir={{ git_root }} creates={{ dib_git_folder }} command: cp -a {{ dib_git_url }} {{ dib_git_folder }} chdir={{ git_root }} creates={{ dib_git_folder }}
- name: "ironic-inspector - Copy into place" - name: "ironic-inspector - Copy into place"
command: cp -a {{ ironicinspector_git_url }} {{ ironicinspector_git_folder }} chdir={{ git_root }} creates={{ ironicinspector_git_folder }} command: cp -a {{ ironicinspector_git_url }} {{ ironicinspector_git_folder }} chdir={{ git_root }} creates={{ ironicinspector_git_folder }}
- name: "python-ironic-inspector-client - Copy into place" - name: "python-ironic-inspector-client - Copy into place"
command: cp -a {{ ironicinspectorclient_git_url }} {{ ironicinspectorclient_git_folder }} chdir={{ git_root }} creates={{ ironicinspectorclient_git_folder }} command: cp -a {{ ironicinspectorclient_git_url }} {{ ironicinspectorclient_git_folder }} chdir={{ git_root }} creates={{ ironicinspectorclient_git_folder }}

View File

@ -16,6 +16,7 @@
- name: "Download via GIT" - name: "Download via GIT"
include: git_download.yaml include: git_download.yaml
when: ci_testing_zuul | bool == false and copy_from_local_path | bool == false when: ci_testing_zuul | bool == false and copy_from_local_path | bool == false
- name: "Copy from local path" - name: "Copy from local path"
include: local_path.yaml include: local_path.yaml
when: ci_testing_zuul | bool == true or copy_from_local_path | bool == true when: ci_testing_zuul | bool == true or copy_from_local_path | bool == true

View File

@ -18,6 +18,7 @@
# install and initial deploy. # install and initial deploy.
- name: Remove pre-existing leases file - name: Remove pre-existing leases file
file: path=/var/lib/misc/dnsmasq.leases state=absent file: path=/var/lib/misc/dnsmasq.leases state=absent
- hosts: localhost - hosts: localhost
connection: local connection: local
name: "Executes install, enrollment, and testing in one playbook" name: "Executes install, enrollment, and testing in one playbook"
@ -51,6 +52,7 @@
environment: environment:
http_proxy: "{{ lookup('env','http_proxy') }}" http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}" https_proxy: "{{ lookup('env','https_proxy') }}"
- hosts: localhost - hosts: localhost
connection: local connection: local
name: "Executes install, enrollment, and testing in one playbook" name: "Executes install, enrollment, and testing in one playbook"
@ -75,6 +77,7 @@
environment: environment:
http_proxy: "{{ lookup('env','http_proxy') }}" http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}" https_proxy: "{{ lookup('env','https_proxy') }}"
- hosts: baremetal - hosts: baremetal
name: "Enroll node with Ironic" name: "Enroll node with Ironic"
become: no become: no
@ -82,6 +85,7 @@
roles: roles:
- role: ironic-enroll-dynamic - role: ironic-enroll-dynamic
- { role: ironic-inspect-node, when: inspect_nodes | default('false') | bool == true } - { role: ironic-inspect-node, when: inspect_nodes | default('false') | bool == true }
- hosts: baremetal - hosts: baremetal
vars: vars:
multinode_testing: "{{ inventory_dhcp | bool == true }}" multinode_testing: "{{ inventory_dhcp | bool == true }}"
@ -93,6 +97,7 @@
- role: bifrost-deploy-nodes-dynamic - role: bifrost-deploy-nodes-dynamic
- role: bifrost-prepare-for-test-dynamic - role: bifrost-prepare-for-test-dynamic
serial: 1 serial: 1
# The testvm Host group is added by bifrost-prepare-for-test based # The testvm Host group is added by bifrost-prepare-for-test based
# on the contents of the CSV file. # on the contents of the CSV file.
- hosts: test - hosts: test
@ -105,6 +110,7 @@
max_fail_percentage: 0 max_fail_percentage: 0
roles: roles:
- role: bifrost-test-vm - role: bifrost-test-vm
- hosts: baremetal - hosts: baremetal
connection: local connection: local
name: "Unprovisions the test node" name: "Unprovisions the test node"
@ -113,6 +119,7 @@
roles: roles:
- role: bifrost-unprovision-node-dynamic - role: bifrost-unprovision-node-dynamic
- role: ironic-delete-dynamic - role: ironic-delete-dynamic
# The following tasks are intended to test DHCP functionality # The following tasks are intended to test DHCP functionality
- hosts: localhost - hosts: localhost
connection: local connection: local
@ -132,6 +139,7 @@
pause: pause:
seconds: 30 seconds: 30
when: inventory_dhcp | bool == true when: inventory_dhcp | bool == true
- hosts: localhost - hosts: localhost
connection: local connection: local
name: "Executes DHCP test script" name: "Executes DHCP test script"