ironic/vagrant.yaml
Pavlo Shchelokovskyy 3d9895cc0b Remove SSH-based driver interfaces and drivers
SSH drivers are being unsupported for about a year now. All current
stable branches of ironic are officially supporting IPMI-capable HW
simulation via virtualbmc.
All ironic-related gate jobs have already been switched
to not use or enable those drivers.

This patch finally removes SSH-based power and managemtnt driver interfaces
and all classic drivers using those from ironic code and documentation.
Related exceptions and `ssh_connect` function, together with dependency
on `paramiko` package are removed as well.

Change-Id: Ieda7249b9cd78e3be1eff37804996295fc8d3969
Closes-Bug: #1570301
Depends-On: I9b60c9fa24652e9e64e787cd4e5b0152f51e7a28
2017-08-01 12:39:39 +00:00

160 lines
5.4 KiB
YAML

---
###############################################################################
# This ansible playbook installs all supporting software necessary to run the
# ironic service locally into the vagrant VM attached. Its intent is to provide
# a quickstart development environment that doesn't pollute an engineer's own
# machine.
#
# The vagrant vm's IP address is assumed to be 192.168.99.11
#
# http://docs.openstack.org/developer/ironic/dev/dev-quickstart.html#exercising-the-services-locally
#
- hosts: ironic
sudo: yes
tasks:
############################################################################
# APT Updates
############################################################################
# Make sure our VM's software is ~@Latest
- name: Apt Update
apt: update_cache=yes
upgrade=dist
cache_valid_time=86400
# Reboot if required.
- name: Reboot system if required
command: shutdown -r now 'Rebooting to complete system upgrade'
removes=/var/run/reboot-required
register: rebooted
- name: Wait for VM Reboot.
sudo: no
local_action: wait_for
port=22
host="{{ip}}"
search_regex=OpenSSH
delay=10
timeout=900
when: rebooted.changed
############################################################################
# Install all the needed packages in one go.
############################################################################
- name: Install Required Packages
apt: name={{item}}
state=present
with_items:
- rabbitmq-server
- python-mysqldb
- mysql-server
- mysql-client
############################################################################
# Configure rabbitmq.
############################################################################
- name: Ensure rabbitmq is running
service: name=rabbitmq-server
state=started
enabled=yes
- name: Add ironic RabbitMQ user
rabbitmq_user: user=ironic
password=ironic
vhost=/
configure_priv=.*
read_priv=.*
write_priv=.*
state=present
############################################################################
# Configure mysql.
############################################################################
- name: Configure MySQL
lineinfile: dest=/etc/mysql/my.cnf
line="bind-address={{ip}}"
regexp="^bind\-address"
notify: Restart MySQL
- name: Create MySQL Database
mysql_db: name=ironic state=present
- name: Create ironic MySQL user
mysql_user: name=ironic
password=ironic
host={{item}}
priv=ironic.*:ALL
state=present
with_items:
- localhost
- "%"
- name: Ensure mysql is running
service: name=mysql
state=started
enabled=yes
############################################################################
# Create ironic.conf.local configuration.
############################################################################
- name: Update local configuration with vagrant parameters.
sudo: no
local_action: ini_file dest=etc/ironic/ironic.conf.local
section="{{item.section}}"
option="{{item.option}}"
value="{{item.value}}"
with_items:
- {
section: 'glance',
option: 'auth_strategy', value: 'noauth'
}
- {
section: 'neutron',
option: 'auth_strategy', value: 'noauth'
}
- {
section: 'database',
option: 'connection', value: "mysql+pymysql://ironic:ironic@{{ip}}/ironic"
}
- {
section: 'DEFAULT',
option: 'auth_strategy', value: 'noauth'
}
- {
section: 'DEFAULT',
option: 'enabled_drivers', value: 'pxe_ipmitool, agent_ipmitool, fake'
# All other testing drivers require add'l packages
# and should be enabled locally, if desired
}
- {
section: 'DEFAULT',
option: 'pecan_debug', value: 'true'
}
- {
section: 'DEFAULT',
option: 'verbose', value: 'true'
}
- {
section: 'DEFAULT',
option: 'debug', value: 'true'
}
- {
section: 'oslo_messaging_rabbit',
option: 'rabbit_host', value: "{{ip}}"
}
- {
section: 'oslo_messaging_rabbit',
option: 'rabbit_userid', value: "ironic"
}
- {
section: 'oslo_messaging_rabbit',
option: 'rabbit_password', value: "ironic"
}
- { # CORS Domain For Ironic-Webclient's dev server.
section: 'cors',
option: 'allowed_origin', value: "http://localhost:8000"
}
#############################################################################
# Handlers
#############################################################################
handlers:
- name: Restart MySQL
service: name=mysql
state=restarted
enabled=yes