Last active
December 5, 2018 15:23
-
-
Save aojea/bbe4ceb06a2319eef7ef007abfcb4d15 to your computer and use it in GitHub Desktop.
cloud-init to install devstack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
# | |
# Use to spawn an instance and install devstack | |
# openstack server create --flavor m1.large --image opensuse150 --key-name mykey --security-group default --security-group "ping/ssh" --user-data cloud-config --nic net-id=cb4f16fb-248e-4095-b359-691f07d307fc leap15-devstack | |
groups: | |
- stack | |
users: | |
- default | |
- name: stack | |
lock_passwd: False | |
sudo: ["ALL=(ALL) NOPASSWD:ALL\nDefaults:stack !requiretty"] | |
shell: /bin/bash | |
groups: stack | |
write_files: | |
- content: | | |
#!/bin/sh | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy update || sudo yum update -qy || sudo zypper -n --gpg-auto-import-keys refresh | |
DEBIAN_FRONTEND=noninteractive sudo apt-get install -qqy git || sudo yum install -qy git || sudo zypper -n --gpg-auto-import-keys install git screen | |
sudo chown stack:stack /home/stack | |
cd /home/stack | |
git clone https://git.openstack.org/openstack-dev/devstack | |
cd devstack | |
echo '[[local|localrc]]' > local.conf | |
echo ADMIN_PASSWORD=password >> local.conf | |
echo DATABASE_PASSWORD=password >> local.conf | |
echo RABBIT_PASSWORD=password >> local.conf | |
echo SERVICE_PASSWORD=password >> local.conf | |
echo INSTALL_TEMPEST=True >> local.conf | |
echo HOST_IP=127.0.0.1 >> local.conf | |
./stack.sh | |
path: /home/stack/start.sh | |
permissions: 0755 | |
runcmd: | |
- su -l stack ./start.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment