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 }
|
- { role: bifrost-prep-for-install, when: skip_install is not defined }
|
||||||
- bifrost-ironic-install
|
- 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: "{{ 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:
|
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') }}"
|
||||||
|
@ -9,7 +9,9 @@
|
|||||||
|
|
||||||
# ironic_db_password ironic user password for rabbit
|
# ironic_db_password ironic user password for rabbit
|
||||||
ironic_db_password: aSecretPassword473z
|
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:
|
mysql_password:
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -11,3 +11,4 @@ dib_clearenv: false
|
|||||||
dib_notmpfs: false
|
dib_notmpfs: false
|
||||||
dib_offline: false
|
dib_offline: false
|
||||||
dib_skipbase: false
|
dib_skipbase: false
|
||||||
|
dib_packages: ""
|
||||||
|
@ -33,10 +33,10 @@
|
|||||||
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: "Create virtual machines"
|
- name: "Create virtual machines"
|
||||||
script: create_vm_nodes-for-role.sh
|
script: create_vm_nodes-for-role.sh
|
||||||
environment:
|
environment:
|
||||||
|
@ -35,11 +35,11 @@
|
|||||||
apt: update_cache=yes
|
apt: update_cache=yes
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_os_family == 'Debian'
|
||||||
- name: "Install packages"
|
- name: "Install packages"
|
||||||
action: "{{ ansible_pkg_mgr }} name={{ item }}"
|
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
|
||||||
with_items: required_packages
|
with_items: required_packages
|
||||||
# Step required for Ubuntu 14.10
|
# Step required for Ubuntu 14.10
|
||||||
- name: "Install Ubuntu 14.10 (and later) packages"
|
- name: "Install Ubuntu 14.10 (and later) packages"
|
||||||
action: "{{ ansible_pkg_mgr }} name={{ item }}"
|
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
|
||||||
with_items:
|
with_items:
|
||||||
- pxelinux
|
- pxelinux
|
||||||
when: ansible_distribution_version|version_compare('14.10', '>=') and ansible_distribution == 'Ubuntu'
|
when: ansible_distribution_version|version_compare('14.10', '>=') and ansible_distribution == 'Ubuntu'
|
||||||
@ -88,12 +88,12 @@
|
|||||||
- name: "Create 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 - Create database"
|
- name: "MySQL - Creating DB"
|
||||||
mysql_db: login_user={{ mysql_username }} login_password={{ mysql_password }} name=ironic state=present encoding=utf8
|
mysql_db: name=ironic state=present encoding=utf8 login_user="{{ mysql_username | default(None) }}" login_password="{{ mysql_password | default(None) }}"
|
||||||
register: test_created_db
|
register: test_created_db
|
||||||
- name: "MySQL - Create user for ironic"
|
- name: "MySQL - Creating 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: 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"
|
- 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: "Create an ironic service group"
|
- 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"
|
- name: "Set ci_testing flag if a list of changes are found in the environment variables"
|
||||||
set_fact:
|
set_fact:
|
||||||
ci_testing: true
|
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"
|
- name: "Set ci_testing_zuul if it appears we are running in upstream OpenStack CI"
|
||||||
set_fact:
|
set_fact:
|
||||||
ci_testing_zuul: true
|
ci_testing_zuul: true
|
||||||
|
@ -23,11 +23,11 @@
|
|||||||
# TODO(TheJulia) Fix the above paths to be consistent, because the NV job gets the dib
|
# 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
|
# folder cloned, while the gate job does not. Likely need to work out a semi-hybrid
|
||||||
# solution.
|
# solution.
|
||||||
when: lookup('env', 'ZUUL_BRANCH') != ""
|
when: lookup('env', 'ZUUL_BRANCH') | length > 0
|
||||||
- name: "Set ci_testing_zuul_changes if ZUUL_CHANGES is set"
|
- name: "Set ci_testing_zuul_changes if ZUUL_CHANGES is set"
|
||||||
set_fact:
|
set_fact:
|
||||||
ci_testing_zuul_changes: true
|
ci_testing_zuul_changes: true
|
||||||
when: lookup('env', 'ZUUL_CHANGES') != ""
|
when: lookup('env', 'ZUUL_CHANGES') | length > 0
|
||||||
- name: "Override the ipv4_gateway setting"
|
- name: "Override the ipv4_gateway setting"
|
||||||
set_fact:
|
set_fact:
|
||||||
ipv4_gateway: "192.168.122.1"
|
ipv4_gateway: "192.168.122.1"
|
||||||
@ -58,7 +58,7 @@
|
|||||||
# do not support ramdisk-image-create as they invoke steps to cleanup
|
# do not support ramdisk-image-create as they invoke steps to cleanup
|
||||||
# the ramdisk which causes ramdisk-image-create to believe it failed.
|
# 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_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:
|
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') }}"
|
||||||
|
@ -2,10 +2,8 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
ANSIBLE_GIT_URL=${ANSIBLE_GIT_URL:-https://github.com/ansible/ansible.git}
|
ANSIBLE_GIT_URL=${ANSIBLE_GIT_URL:-https://github.com/ansible/ansible.git}
|
||||||
# NOTE(TheJulia): Switching to Ansible stable-1.9 branch as the development
|
# Note(TheJulia): Presently defaulting to stable-1.9, although the syntax
|
||||||
# branch is undergoing some massive changes and we are seeing odd failures
|
# is compatible with the Ansible devel branch as of 20150923.
|
||||||
# that we should not be seeing. Until devel has stabilized, we should stay
|
|
||||||
# on the stable branch.
|
|
||||||
ANSIBLE_GIT_BRANCH=${ANSIBLE_GIT_BRANCH:-stable-1.9}
|
ANSIBLE_GIT_BRANCH=${ANSIBLE_GIT_BRANCH:-stable-1.9}
|
||||||
|
|
||||||
if [ -x '/usr/bin/apt-get' ]; then
|
if [ -x '/usr/bin/apt-get' ]; then
|
||||||
|
@ -26,7 +26,7 @@ cd $BIFROST_HOME/playbooks
|
|||||||
|
|
||||||
# Syntax check of dynamic inventory test path
|
# 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-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
|
# Create the test VM
|
||||||
ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml
|
ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user