Merge "Ansible 2.0 compatibility"
This commit is contained in:
commit
ac866d0135
@ -8,7 +8,7 @@
|
||||
- { role: bifrost-prep-for-install, when: skip_install is not defined }
|
||||
- bifrost-ironic-install
|
||||
- { role: bifrost-create-dib-image, dib_imagename: "{{ http_boot_folder }}/ipa", build_ramdisk: false, dib_os_element: "{{ ipa_dib_os_element|default('debian') }}", dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}", when: create_ipa_image | bool == true }
|
||||
- { role: bifrost-create-dib-image, dib_imagename: "{{ deploy_image }}", dib_imagetype: "qcow2", dib_os_element: "{{ dib_os_element|default('debian') }}", dib_elements: "vm serial-console simple-init {{ extra_dib_elements|default('') }}", dib_packages: "{{ dib_packages|default('') }}", when: create_image_via_dib == true and transform_boot_image == false }
|
||||
- { role: bifrost-create-dib-image, dib_imagename: "{{ deploy_image }}", dib_imagetype: "qcow2", dib_elements: "vm serial-console simple-init {{ extra_dib_elements|default('') }}", when: create_image_via_dib == true and transform_boot_image == false }
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
# ironic_db_password ironic user password for rabbit
|
||||
ironic_db_password: aSecretPassword473z
|
||||
# mysql_password: mysql root user password
|
||||
# mysql_username: Default mysql admin username
|
||||
mysql_username: root
|
||||
# mysql_password: Default mysql admin user password
|
||||
mysql_password:
|
||||
|
||||
# The path to the SSH key to be utilized for testing and burn-in
|
||||
|
@ -11,3 +11,4 @@ dib_clearenv: false
|
||||
dib_notmpfs: false
|
||||
dib_offline: false
|
||||
dib_skipbase: false
|
||||
dib_packages: ""
|
||||
|
@ -33,10 +33,10 @@
|
||||
ansible_pkg_mgr: "dnf"
|
||||
when: ansible_distribution == 'Fedora' and "{{ test_dnf.stat.exists|bool }}"
|
||||
- name: "Install required packages"
|
||||
action: "{{ ansible_pkg_mgr }} name={{item}} state=present"
|
||||
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
|
||||
with_items: required_packages
|
||||
- name: "Restart libvirt service"
|
||||
service: name={{libvirt_service_name}} state=restarted
|
||||
service: name="{{libvirt_service_name}}" state=restarted
|
||||
- name: "Create virtual machines"
|
||||
script: create_vm_nodes-for-role.sh
|
||||
environment:
|
||||
|
@ -35,11 +35,11 @@
|
||||
apt: update_cache=yes
|
||||
when: ansible_os_family == 'Debian'
|
||||
- name: "Install packages"
|
||||
action: "{{ ansible_pkg_mgr }} name={{ item }}"
|
||||
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
|
||||
with_items: required_packages
|
||||
# Step required for Ubuntu 14.10
|
||||
- name: "Install Ubuntu 14.10 (and later) packages"
|
||||
action: "{{ ansible_pkg_mgr }} name={{ item }}"
|
||||
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
|
||||
with_items:
|
||||
- pxelinux
|
||||
when: ansible_distribution_version|version_compare('14.10', '>=') and ansible_distribution == 'Ubuntu'
|
||||
@ -88,12 +88,12 @@
|
||||
- name: "Create ironic user in RabbitMQ"
|
||||
rabbitmq_user: user=ironic password={{ ironic_db_password }} force=yes state=present configure_priv=.* write_priv=.* read_priv=.*
|
||||
no_log: true
|
||||
- name: "MySQL - Create database"
|
||||
mysql_db: login_user={{ mysql_username }} login_password={{ mysql_password }} name=ironic state=present encoding=utf8
|
||||
- name: "MySQL - Creating DB"
|
||||
mysql_db: name=ironic state=present encoding=utf8 login_user="{{ mysql_username | default(None) }}" login_password="{{ mysql_password | default(None) }}"
|
||||
register: test_created_db
|
||||
- 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
|
||||
- name: "Install ironic using pip"
|
||||
- name: "MySQL - Creating user for Ironic"
|
||||
mysql_user: name=ironic password='{{ ironic_db_password }}' priv=ironic.*:ALL state=present login_user="{{ mysql_username | default(None) }}" login_password="{{ mysql_password | default(None) }}"
|
||||
- name: "Install Ironic using pip"
|
||||
pip: name={{ ironic_git_folder }} state=latest
|
||||
when: skip_install is not defined
|
||||
- name: "Create an ironic service group"
|
||||
|
@ -13,7 +13,7 @@
|
||||
- name: "Set ci_testing flag if a list of changes are found in the environment variables"
|
||||
set_fact:
|
||||
ci_testing: true
|
||||
when: lookup('env', 'ZUUL_CHANGES') != ""
|
||||
when: lookup('env', 'ZUUL_CHANGES') | length > 0
|
||||
- name: "Set ci_testing_zuul if it appears we are running in upstream OpenStack CI"
|
||||
set_fact:
|
||||
ci_testing_zuul: true
|
||||
|
@ -23,11 +23,11 @@
|
||||
# TODO(TheJulia) Fix the above paths to be consistent, because the NV job gets the dib
|
||||
# folder cloned, while the gate job does not. Likely need to work out a semi-hybrid
|
||||
# solution.
|
||||
when: lookup('env', 'ZUUL_BRANCH') != ""
|
||||
when: lookup('env', 'ZUUL_BRANCH') | length > 0
|
||||
- name: "Set ci_testing_zuul_changes if ZUUL_CHANGES is set"
|
||||
set_fact:
|
||||
ci_testing_zuul_changes: true
|
||||
when: lookup('env', 'ZUUL_CHANGES') != ""
|
||||
when: lookup('env', 'ZUUL_CHANGES') | length > 0
|
||||
- name: "Override the ipv4_gateway setting"
|
||||
set_fact:
|
||||
ipv4_gateway: "192.168.122.1"
|
||||
@ -58,7 +58,7 @@
|
||||
# do not support ramdisk-image-create as they invoke steps to cleanup
|
||||
# the ramdisk which causes ramdisk-image-create to believe it failed.
|
||||
- { role: bifrost-create-dib-image, dib_imagename: "{{ http_boot_folder }}/ipa", build_ramdisk: false, dib_os_element: "{{ ipa_dib_os_element|default('debian') }}", dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}", when: create_ipa_image | bool == true }
|
||||
- { role: bifrost-create-dib-image, dib_imagetype: "qcow2", dib_imagename: "{{deploy_image}}", dib_os_element: "{{ dib_os_element|default('debian') }}", dib_elements: "vm serial-console simple-init {{ extra_dib_elements|default('') }}", dib_packages: "{{ dib_packages|default('') }}", when: create_image_via_dib == true and transform_boot_image == false }
|
||||
- { role: bifrost-create-dib-image, dib_imagetype: "qcow2", dib_imagename: "{{deploy_image}}", dib_os_element: "debian", dib_elements: "vm serial-console simple-init {{ extra_dib_elements|default('') }}", when: create_image_via_dib == true and transform_boot_image == false }
|
||||
environment:
|
||||
http_proxy: "{{ lookup('env','http_proxy') }}"
|
||||
https_proxy: "{{ lookup('env','https_proxy') }}"
|
||||
|
@ -2,10 +2,8 @@
|
||||
set -e
|
||||
|
||||
ANSIBLE_GIT_URL=${ANSIBLE_GIT_URL:-https://github.com/ansible/ansible.git}
|
||||
# NOTE(TheJulia): Switching to Ansible stable-1.9 branch as the development
|
||||
# branch is undergoing some massive changes and we are seeing odd failures
|
||||
# that we should not be seeing. Until devel has stabilized, we should stay
|
||||
# on the stable branch.
|
||||
# Note(TheJulia): Presently defaulting to stable-1.9, although the syntax
|
||||
# is compatible with the Ansible devel branch as of 20150923.
|
||||
ANSIBLE_GIT_BRANCH=${ANSIBLE_GIT_BRANCH:-stable-1.9}
|
||||
|
||||
if [ -x '/usr/bin/apt-get' ]; then
|
||||
|
@ -26,7 +26,7 @@ cd $BIFROST_HOME/playbooks
|
||||
|
||||
# Syntax check of dynamic inventory test path
|
||||
ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml --syntax-check --list-tasks
|
||||
ansible-playbook -vvvv -i inventory/localhost test-bifrost-dynamic.yaml --syntax-check --list-tasks
|
||||
ansible-playbook -vvvv -i inventory/localhost test-bifrost-dynamic.yaml --syntax-check --list-tasks -e testing_user=cirros
|
||||
|
||||
# Create the test VM
|
||||
ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user