blob: 0ee6a947584d6345f64f597bf6984f01087c7330 [file] [log] [blame]
Dean Troyer1023ff72014-01-27 14:56:44 -06001# ironic.sh - Devstack extras script to install ironic
2
Jim Rollenhagen9fc3ba42015-12-10 13:33:28 +00003# NOTE(jroll) this is used for the transition to a devstack plugin in
4# the ironic tree.
5IRONIC_USING_PLUGIN=$(trueorfalse False IRONIC_USING_PLUGIN)
6if [[ "$IRONIC_USING_PLUGIN" == "True" ]] ; then
7 return 0
8fi
9
Dean Troyer1023ff72014-01-27 14:56:44 -060010if is_service_enabled ir-api ir-cond; then
11 if [[ "$1" == "source" ]]; then
12 # Initial source
13 source $TOP_DIR/lib/ironic
14 elif [[ "$1" == "stack" && "$2" == "install" ]]; then
15 echo_summary "Installing Ironic"
16 install_ironic
17 install_ironicclient
18 cleanup_ironic
19 elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
20 echo_summary "Configuring Ironic"
21 configure_ironic
22
23 if is_service_enabled key; then
24 create_ironic_accounts
25 fi
26
27 elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
28 # Initialize ironic
29 init_ironic
30
31 # Start the ironic API and ironic taskmgr components
32 echo_summary "Starting Ironic"
33 start_ironic
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040034
35 if [[ "$IRONIC_BAREMETAL_BASIC_OPS" = "True" ]]; then
36 prepare_baremetal_basic_ops
37 fi
Dean Troyer1023ff72014-01-27 14:56:44 -060038 fi
39
40 if [[ "$1" == "unstack" ]]; then
41 stop_ironic
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040042 if [[ "$IRONIC_BAREMETAL_BASIC_OPS" = "True" ]]; then
43 cleanup_baremetal_basic_ops
44 fi
Yuriy Zveryanskyyc86ec352014-02-12 11:03:18 +020045 fi
46
47 if [[ "$1" == "clean" ]]; then
Dean Troyer1023ff72014-01-27 14:56:44 -060048 cleanup_ironic
49 fi
50fi